http://www.perlmonks.org?node_id=374318

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Monks, I have had plenty of success both reading and writing excel files using Spreadsheet::Parseexcel and Spreadsheet::WriteExcel. I am currently trying read an excel file that uses macros, but I cant seem to even open it. I am getting the following error:
substr outside of string at C:/Perl/site/lib/Spreadsheet/ParseExcel.pm + line 1855.
I looked at the code, but its over my head. When you open the file in excel you are prompted to either enable the macros or disable...with this file I need to enable them. Any help would be appreciaited

Replies are listed 'Best First'.
Re: reading excel with macros
by dragonchild (Archbishop) on Jul 14, 2004 at 15:37 UTC
    Submit a bug to the author using rt.cpan.org. When you do so, make sure you attach the simplest Excel file you can create that has this problem. Remember - CPAN authors need the same amount of user-assisted debugging that you do when talking to your users. The more footwork you do, the more likely the author is to find the bug in a reasonable amount of time.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

Re: reading excel with macros
by crabbdean (Pilgrim) on Jul 14, 2004 at 16:00 UTC
    Having not read the ParseExcel.pm code or looked further into your problem my immediate thought was that the disable/enable prompt in Excel could be killing your script. Try going into Excel and turning down the security warnings relating to macros. I'm pretty sure you can set it to accept all files with macros so that it doesn't do this disable/enable prompt. This might be all it is that's killing your script. Just a suggestion.

    Dean
    The Funkster of Mirth
    Programming these days takes more than a lone avenger with a compiler. - sam
    RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers