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 }

In reply to Win32::OLE Excel issue by sgp_perl_user

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.