in reply to Re^2: Parse error in Spreadsheet::ParseExcel::Simple
in thread Parse error in Spreadsheet::ParseExcel::Simple

igelkott:

I suspect that it's not a corrupt file, but that the sheets may not be stored in order of appearance on the tab bar. To check it, try adding the method:

sub sheet_name { shift->{sheet}->{Name}; }

to the Spreadsheet::ParseExcel::Simple.pm file, then you can print the sheet name associated with the sheet to check it out. Then, of course, let me know what you discover!

...roboticus

Replies are listed 'Best First'.
Re^4: Parse error in Spreadsheet::ParseExcel::Simple
by igelkott (Priest) on Apr 22, 2008 at 19:51 UTC
    roboticus,

    Added your method to Simple.pm and a print $sheet->sheet_name to the script shown in the original post.

    The sheet names appear in the correct order but the contents do not. Specifically, I get:

    name = sheet 1
    contents = sheet 4
    name = sheet 2
    contents = sheet 2
    name = sheet 3
    contents = sheet 3
    name = sheet 4
    contents = empty

    It's the contents of sheet 1 I'm interested in but can't find. This is like the test with Spreadsheet::ParseExcel above but I was a bit vague (inaccurate) there.

    How to solve my immediate issue is one thing but it's of course more interesting to figure out if this has identified a general bug. I'll play with Data::Dumper, etc to see if anything interesting comes up but not sure how far I'll get into the module source code...