Hello Monks, I have a perl application which was working fine in MS Excel 2003. We got upgraded to Office 2007 and the application stopped working. On troubleshooting I have narrowed it down to "ApplyDataLabel" when its trying to create a chart. the code lines are .... my $book = $excel->workbooks->add; my $sheet = $book->worksheets(1); . . . my $Chart = $excel->Charts->Add; $chart->{ChartType} = xlColumnClustered; $Chart->{DepthPercent} = 100 || win32_error("DepthPercent"); $Chart->{HasLegend} =0 || win32_error("HasLegend"); $Chart->SetSourceData({Source=>$Range, PlotBy =>xlColumns}); $Chart->SeriesCollection(1)->ApplyDataLabels->{AutoText}=1; $Chart->SeriesCollection(1)->ApplyDataLabels->{ShowValue}=1; The code works fine in Excel 2003 but dies in 2007 at the line: $Chart->SeriesCollection(1)->ApplyDataLabels->{AutoText}=1; complaining that cannot set hash reference with null values ??? On Commenting this the code processes through and finishes running. The charts are drawn , just that they are missing some borders. It appears that something changes in Excel 2007 from 2003 which has broken the method "ApplyDataLabels". IS anybody aware of any such changes ?? Thank You, regards,

In reply to Perl Win32::OLE Excel Charts -- ApplyDataLabels by pawansharma01

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.