Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: OLE - updating a chart in an excel spreadsheet

by Rom399 (Initiate)
on Mar 17, 2004 at 13:32 UTC ( #337324=note: print w/ replies, xml ) Need Help??


in reply to Re: OLE - updating a chart in an excel spreadsheet
in thread OLE - updating a chart in an excel spreadsheet

Every thing up to here works, soon as i put in this bit of code i get the perl interpreter crash hence no error messages.

### Here we update the graphs sourcedata my $Chart1 = $RequestsSheet->ChartObjects("Chart 1"); $Chart1->Activate(); my $name = $Chart1->Name(); print "Chart1 Name: ", $name ,"\n";\ $RequestsSheet->ChartObjects("Chart 1")->Activate(); ############### This line here blows everything up. $Chart1->SetSourceData({Source => '=Data!\$A\$2:\$A\$295'} +);
I have tried to update the Chart1 sourceData this way as well also get the perl interpreter to crash. No error messages.
### Here we update the graphs sourcedata my $Chart1 = $RequestsSheet->ChartObjects("Chart 1"); my $sourceRange = "A1:A295,G1:G295"; my $Chart1Range = $DataSheet->Range($sourceRange); ############### This line here blows everything up. $Chart1->SetSourceData({Source =>$Chart1Range,PlotBy => xl +Columns});


Comment on Re: Re: OLE - updating a chart in an excel spreadsheet
Select or Download Code
Re: Re: Re: OLE - updating a chart in an excel spreadsheet
by jmcnamara (Monsignor) on Mar 18, 2004 at 21:45 UTC

    You don't need to escape the $ in a single quoted string.
    # This line here blows everything up. $Chart1->SetSourceData({Source =>'=Data!\$A\$2:\$A\$295'}

    However, that doesn't fix the problem. The syntax of the second example using the Excel range seems correct but doesn't work. I tried several variations with no success.

    --
    John.

Reaped: Re^3: OLE - updating a chart in an excel spreadsheet
by NodeReaper (Curate) on Oct 13, 2012 at 00:33 UTC
Re^3: OLE - updating a chart in an excel spreadsheet
by Anonymous Monk on Oct 13, 2012 at 00:33 UTC

    This works for me

    my $Chart1Range = $DataSheet->Range("A1:A295,G1:G295"); $Chart1->SetSourceData($Chart1Range,xlColumns);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://337324]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-09-20 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls