sgp_perl_user has asked for the wisdom of the Perl Monks concerning the following question:
I encountered a problem while developing my PERL script which reads Excel files and do some calculations. I use ActivePerl 5.14.2 Build 14R02 on Windows XP (I am not asking you to help debug ActivePerl but just to provide full info).
Is there a bug list for Win32::OLE that documents issues with Excel?
If there is a more appropriate forum to raise this question, please let me know.
Note that the code was working before (and I saved old versions of the working code).
All of a sudden the script fails on opening the Excel workbook using the call $in_Excel->Workbooks->open($workbook) & $workbook is the workbook filename . This is the error message: "Can't call method "Worksheets" on an undefined value at xls2csv.pl line 15"
I put a "print $workbook; " statement before the call and the proper filename (residing in the same directory). Running the old working code gets me the same error.
Please help.
Code extraction:
sub LoadFile { my $map_file = shift; print "$map_file\n"; my $in_Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win +32::OLE->new('Excel.Application', 'Quit'); my $in_eBook = $in_Excel->Workbooks->open($map_file) || die "Failed to + open Workbook $map_file.\n";; # dies at the last statement }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE Excel issue
by davies (Monsignor) on Feb 02, 2012 at 10:13 UTC | |
|
Re: Win32::OLE Excel issue
by Corion (Patriarch) on Feb 02, 2012 at 08:49 UTC | |
|
Re: Win32::OLE Excel issue
by Anonymous Monk on Feb 02, 2012 at 08:56 UTC |