ralife has asked for the wisdom of the Perl Monks concerning the following question:
OLE exception from "Microsoft Office Excel": Unable to set the HasTitle property of the Chart class Win32::OLE(0.1707) error 0x80020009: "Exception occurred" in PROPERTYPUT "HasTitle" at Processor.pl line 1044
$mcr_crtime_chart->{HasTitle} = 1; $mcr_crtime_chart->ChartTitle->{Text} = "MCRByURN-CreateTime";
OLE exception from "Microsoft Office Excel": Unable to set the Position property of the Legend class Win32::OLE(0.1707) error 0x80020009: "Exception occurred" in PROPERTYPUT "Position" at Processor.pl line 1043
$mcr_crtime_chart->{HasLegend} = 1; $mcr_crtime_chart->Legend->{Position} = xlRight;
OLE exception from "Microsoft Office Excel": Unable to set the Name property of the Series class Win32::OLE(0.1707) error 0x80020009: "Exception occurred" in PROPERTYPUT "Name" at Processor.pl line 1056
If anyone has any suggestions they would be greatly appreciated. Thanks in advance!use OLE; use Win32::OLE qw(in with); use Win32::OLE::Const "Microsoft Excel"; use Win32::OLE::Variant; use Win32::OLE::NLS qw(:LOCALE :DATE); $Excel = Win32::OLE->GetActiveObject('Excel.Application')||Win32::OLE- +>new('Excel.Application','Quit'); $Excel->{DisplayAlerts}=0; $Excel->{SheetsInNewWorkbook} = 16; $Book = $Excel->Workbooks->Add; $mcr_crtime_chart = $Excel->Charts->Add({After => $mcrsa_crtab_she +et}); $mcr_crtime_chart->{Name} = "CreateTime_Graph"; $mcr_crtime_chart->{ChartType} = xlXYScatterLines; $mcr_crtime_chart->{HasLegend} = 1; # $mcr_crtime_chart->Legend->{Position} = xlRight; # $mcr_crtime_chart->{HasTitle} = 1; # $mcr_crtime_chart->ChartTitle->{Text} = "MCRByURN-CreateTime"; $x_range = $mcrsa_crtab_sheet->Range("B2:B69"); $mcr_crtime_chart->SetSourceData($mcrsa_crtab_sheet->Range("A2:D69 +"),xlColumns); $mcr_crtime_chart->SeriesCollection->LetProperty('XValues',$x_rang +e); for ($p = 2; $p < $ct_max_column; $p++) { $y_range[$p] = $mcrsa_crtab_sheet->Range("$LetterByNumber{$p}2:$ +LetterByNumber{$p}$ct_row"); $mcr_crtime_chart->SeriesCollection($p)->LetProperty('YValues',$ +y_range[$p]); $mcr_crtime_chart->SeriesCollection($p)->{Name} = "Series $p"; } my $Xaxes = $mcr_crtime_chart->Axes(xlCategory,xlPrimary); $Xaxes->{HasTitle} = 1; $Xaxes->{AxisTitle}->{Characters}->{Text} = "Create Time (sec)"; my $Yaxes = $mcr_crtime_chart->Axes(xlValue,xlPrimary); $Yaxes->{HasTitle} = 1; $Yaxes->{AxisTitle}->{Characters}->{Text} = "MCR (%)";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem Graphing to Excel with Win32::OLE
by marto (Cardinal) on Jun 05, 2008 at 19:56 UTC | |
by Phoenix Rising (Initiate) on Jun 05, 2008 at 19:59 UTC | |
by marto (Cardinal) on Jun 05, 2008 at 20:14 UTC | |
by ralife (Novice) on Jun 05, 2008 at 20:17 UTC | |
by marto (Cardinal) on Jun 05, 2008 at 20:46 UTC | |
by ralife (Novice) on Jun 05, 2008 at 21:21 UTC | |
|
Re: Problem Graphing to Excel with Win32::OLE
by nbartusi (Scribe) on Jun 06, 2008 at 14:59 UTC |