Nalina has asked for the wisdom of the Perl Monks concerning the following question:
The error I get isuse Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; use Win32::OLE::NLS qw(:LOCALE :DATE); use Win32::OLE; use Win32::OLE::Const; $Win32::OLE::Warn = 3; # die on errors... my $filter = 'PNG'; # can be GIF, JPG, JPEG or PNG $filename = "C:\\graph1.xls"; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); # use the Exc +el application if it's open, otherwise open new my $Book = $Excel->Workbooks->Open( $filename ); # open the fi +le foreach my $Sheet (in $Book->Sheets) { # loop through all shee +ts foreach my $ChartObj (in $Sheet->ChartObjects) { # loop throug +h all chartobjects in the sheet #$pngsave = join("",split(/\s+/,$graphtitle)); $dirpath = "c:\\ExcelTest"; mkdir ("$dirpath", 0777); my $savename = "$dirpath\\test" . ".$filter"; # Write image to PNG file $ChartObj->Chart->Export({ FileName => $savename1, FilterName => $filter, Interactive => 0}); } }
What does this mean?Win32::OLE<0.1701> error 0x800a03ec in METHOD/PROPERTYGET "Export" at C:\test.pl line 26
20050328 Edit by castaway: Changed title from 'Perl & Win32'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl & Win32
by mlh2003 (Scribe) on Mar 18, 2005 at 11:32 UTC | |
by gellyfish (Monsignor) on Mar 18, 2005 at 11:42 UTC | |
|
Re: Perl & Win32
by gellyfish (Monsignor) on Mar 18, 2005 at 11:33 UTC | |
by bart (Canon) on Mar 18, 2005 at 11:43 UTC | |
by spurperl (Priest) on Mar 18, 2005 at 11:53 UTC | |
by gellyfish (Monsignor) on Mar 18, 2005 at 12:13 UTC | |
by bart (Canon) on Mar 18, 2005 at 12:12 UTC |