I use the perl module Spreadsheet::ParseExcel and it works really great. Last week i've got a problem with a special kind of Exel-Files. There are seven Worksheets with data (numbers) and three with diagrams. When I print out the contents of an Excel file with the sample script dmpEx.pl the data from the last worksheet appears in first worksheet. Here is the sample script from the author of the module
use strict; if(!(defined $ARGV[0])) { print<<EOF; Usage: $0 Excel_File EOF exit; } use Spreadsheet::ParseExcel; my $oExcel = new Spreadsheet::ParseExcel; my $oBook = $oExcel->Parse($ARGV[0]); my($iR, $iC, $oWkS, $oWkC); print "=========================================\n"; print "FILE :", $oBook->{File} , "\n"; print "COUNT :", $oBook->{SheetCount} , "\n"; print "AUTHOR:", $oBook->{Author} , "\n"; #for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) { # $oWkS = $oBook->{Worksheet}[$iSheet]; foreach my $oWkS (@{$oBook->{Worksheet}}) { print "--------- SHEET:", $oWkS->{Name}, "\n"; for(my $iR = $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) + { for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxC +ol} ; $iC++) { $oWkC = $oWkS->{Cells}[$iR][$iC]; print "( $iR , $iC ) =>", $oWkC->Value, "\n" if($oWkC); print $oWkC->{_Kind}, "\n"; } } }
This error occurs when the last worksheet with data is placed in the Excel File behind the worksheets with diagrams. When the diagrams are at the end of the Excel File then it works fine. I don't know is there a bug in the perl module or maybe this is an Excel bug ? I use Excel2000 on Windows XP SP1 and perl v5.8.5 on SUSE Linux 9.2 and Spreadsheet-ParseExcel-0.2603. I am sorry about my bad english, i hope you understand what is the problem i have. :) Maybe you have some time to have a look at this problem.

In reply to trouble with Spreadsheet::ParseExcel by luckyluke

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.