Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Can't parse all worksheets in Spreadsheet::ParseExcel

by keithw99 (Initiate)
on Jul 24, 2008 at 21:00 UTC ( [id://699963]=perlquestion: print w/replies, xml ) Need Help??

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

Hi,

I've used Spreadsheet::ParseExcel on and off for a while, but recently came across a problem that I can't seem to figure out.

I'm trying to parse a workbook with many tabs (worksheets), but only a few of the worksheets are returning valid data.

In particular, I'm not getting values for $worksheet->{MinRow}, $worksheet->{MaxRow}, etc, even though the cells in these sheets are fully populated with data. When I try to access known cells using $worksheet->{Cells}[0][0]->{Val}, no value is returned (NULL). Of the 22 worksheets in the workbook, the first 4 return valid data, but the rest don't.

Could this be a memory problem or a spreadsheet format problem? The workbook I'm parsing has macros and other stuff embedded, but I don't think that should make a difference. Anyone have an idea on how I could troubleshoot this further? Thanks!

  • Comment on Can't parse all worksheets in Spreadsheet::ParseExcel

Replies are listed 'Best First'.
Re: Can't parse all worksheets in Spreadsheet::ParseExcel
by toolic (Bishop) on Jul 24, 2008 at 21:22 UTC
    I do not have a solution to your problem, but here are some things you could try:
    • Sift through the 31 bugs listed in Spreadsheet::ParseExcel (click the "View Bugs" link).
    • Use Super Search, text = "ParseExcel".
    • Delete all but 4 of your worksheets. Do you still get the problem? If so, there may be something quirky about your 4th sheet. If not, there may be a memory issue, as you suspect. Try to reduce the amount of data to pinpoint the problem.
    • Remember that print and Data::Dumper are your friends.
    Good luck.
Re: Can't parse all worksheets in Spreadsheet::ParseExcel
by igelkott (Priest) on Jul 24, 2008 at 22:53 UTC

    Had a similar problem a while back. Never did find a good solution for my situation but Win32::OLE might be useful in your environment, at least for tracking down the problem. May also get some inspiration from the replies to my first question or to the followup.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://699963]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found