Excel Chart SeriesCollection Error

Discussion in 'Perl' started by Brian Shade, Sep 9, 2004.

  1. Brian Shade

    Brian Shade Guest

    Hi all. I am having a bit of a problem with my Perl script and the
    creation of a chart. I can create the chart and create a new
    SeriesCollection. I then specify the XValues and the Values parameter
    of the first SeriesCollection object. I add another SeriesCollection,
    but I am only able to set the XValues and I get the following error
    when I try to set the Values parameter:

    OLE exception from "Microsoft Office Excel":

    Unable to set the Values property of the Series class

    Win32::OLE(0.1701) error 0x80020009: "Exception occurred"
    in PROPERTYPUT "Values" at winprocgraph.pl line 101

    Here is the snippet of code that is causing me this headache:

    #$chart - chart object
    #$xls - workbook object
    #$worksheet - worksheet object

    $chart = $xls->Charts->Add();
    $chart->SetSourceData({Source=>$worksheet->Range("A1")});
    $chart->{ChartType} = xlXYScatter;

    $chart->SeriesCollection->NewSeries();
    $chart->SeriesCollection->NewSeries();
    #this series gets added correctly
    $chart->SeriesCollection(1)->{XValues} = "='LOGIC'!R2C1:R231C1";
    $chart->SeriesCollection(1)->{Values} = "='LOGIC'!R2C2:R231C2";
    #only the XValues is added correctly here
    $chart->SeriesCollection(2)->{XValues} = "='LOGIC'!R2C3:R231C3";
    $chart->SeriesCollection(2)->{Values} = "='LOGIC'!R2C4:R231C4";

    $chart->Location({Where=>xlLocationAsObject, Name=>"GRAPH"});

    Any help would be greatly appreciated. I have been searching online
    for examples to try and see what I am doing wrong, and so far it looks
    correct to me. Thanks in advance.

    Brian
     
    Brian Shade, Sep 9, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,571
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  2. gnewsgroup
    Replies:
    4
    Views:
    3,045
    Kevin Spencer
    Feb 6, 2008
  3. Tarek
    Replies:
    6
    Views:
    337
    Chris Hohmann
    Nov 19, 2004
  4. Replies:
    1
    Views:
    882
  5. axroh
    Replies:
    1
    Views:
    216
    axroh
    Jul 10, 2007
Loading...

Share This Page