1

I am building trending charts using Win32::OLE in active perl. I am trying to set the major axis unit so that I will get only 7 points in the x-axis. For that I am using the below code:

              with( $chart->Axes( xlCategory ),
                    CategoryType                    => 3,
                    MajorUnit                       => ceil( ( $end - $start ) / 7 ),
                    MajorUnitScale                  => xlDays );

This is not working in Excel2007 but working fine Excel2010. Using Excel 2010, returns the end and start date as "41124.5" and "40767". But Excel 2007, returns as "Fri 12 Aug 00:00" and "Fri 3 Aug 12:00". As a reason, its not working. How can I transform this strings to numeric format?

Kallol
  • 302
  • 4
  • 16

1 Answers1

1

According to this MSDN page this feature should work with Office 2003 and Office 2010. The 2007 version is not mentioned.

dgw
  • 13,418
  • 11
  • 56
  • 54
  • I got this [MSDN Page](http://msdn.microsoft.com/en-us/library/bb208716%28v=office.12%29.aspx) which documents this property in Office 2007 – Kallol Feb 07 '12 at 15:58
  • Strange. What does 'not working' mean? Have you tried static values (`MajorUnit => 7`)? – dgw Feb 07 '12 at 16:11
  • What I was trying to do, to make the chart readable, I want only the x-axis to have only 7 labels, instead of say about 100 labels. This is happening in Excel2010 but not in Excel2007. – Kallol Feb 08 '12 at 04:46