Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am new to perl and I am trying use perl to automate the process of executing a program, process the the result and present the data in Excel. I ve followed the samples in your site and some other resources, but the win32::ole function didnt work very well with excel in my case:
I can create a workbook, insert data and create a new chart with perl in excel, however, I cannot change the chart type, set the tile, axis title or run a macro.
I use the following code to
#create chart and title: my $Chart = $ex->Charts->Add; $Chart->{HasTitle} = 1; my($title)="Analysis Result ".$fileIndex; $Chart->ChartTitle->{Text} = $title; #define cahrt type: $Chart->{ChartType} = "xlLineMarkers"; $Chart->Location({Where => "xlLocationAsNewSheet"}); #set axis title: my $Xaxes = $Chart->Axes("xlCategory", "xlPrimary"); $Xaxes->{HasTitle} = 1; $Xaxes->{AxisTitle}->{Characters}->{Text} = "X Title"; my $Yaxes = $Chart->Axes("xlValue", "xlPrimary"); $Yaxes->{HasTitle} = 1; $Yaxes->{AxisTitle}->{Characters}->{Text} = "Y Title";
I ve put all this in the perl program but it has no effect, the chart always diplay as bar charts, and I can use perl to delete and data set in it.
Also If I insert the data first and create chart, as I can remove the data set, it alwasy give me the wrong data set in chart.
what's wrong with the code, I really dont know, are there any setting that I need to set on excel to use this function?
It is a kinda urgent one :(, I would appriciate if anyone could give me some advice.
thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using win32::ole on Excel
by VSarkiss (Monsignor) on Oct 27, 2002 at 23:44 UTC | |
by Anonymous Monk on Oct 28, 2002 at 00:20 UTC | |
|
Re: Using win32::ole on Excel
by cacharbe (Curate) on Oct 28, 2002 at 18:07 UTC |