in reply to OLE - updating a chart in an excel spreadsheet

You have not identified the error you are getting - but I suspect it is in the SetSourceData call. The SourceData "Source" parameter takes a RANGE object. It appears you are trying to assign it a string.

My recommendation would be to use Named ranges. In the original chart, setup the source data to a named range. Then, in you code, you can simply change the range cells that the name points to, and you are done.

Offense, like beauty, is in the eye of the beholder, and a fantasy.
By guaranteeing freedom of expression, the First Amendment also guarntees offense.

  • Comment on Re: OLE - updating a chart in an excel spreadsheet

Replies are listed 'Best First'.
Re: Re: OLE - updating a chart in an excel spreadsheet
by Rom399 (Initiate) on Mar 17, 2004 at 06:21 UTC
    Most of the time i don't get a error or error message. I get a compile crash when it get's to the sourceData update.. Also tryed using this but more perl interpreter crashes :(
    ### Here we update the graphs sourcedata my $Chart1 = $RequestsSheet->ChartObjects("Chart 1"); my $sourceRange = "A1:A295,G1:G295"; my $Chart1Range = $DataSheet->Range($sourceRange); $Chart1->SetSourceData({Source =>$Chart1Range,PlotBy => xl +Columns});