in reply to Re^2: Error reading Excel Cell Value
in thread Error reading Excel Cell Value


Wow, that's a big number.

I work with this module on a daily basis, and when I see weird behavior like this, it is usually due to things like hidden worksheets in the Excel workbook, or the Excel workbook was generated by some other software package.

I don't even know if this is possible via perlmonks.org, but if you're comfortable with posting/attaching the exact Excel file that is giving you this problem, I wouldn't mind taking a look at it myself.

If there's no way to post a file here, I could possibly give you an email address to send the file to.

Replies are listed 'Best First'.
Re^4: Error reading Excel Cell Value
by sandeep78 (Novice) on Oct 07, 2008 at 12:15 UTC
    Hi,
    I would be happy to send you the spread sheet. Can you please send me your email address.
    Thank you!
      I ran the following code on your file:
      #!/usr/bin/perl use strict; use warnings; use Data::Dumper::Simple; use Spreadsheet::ParseExcel; my $workbook = 'test.xls'; my $worksheet_name = 'Sheet1'; my $wb = Spreadsheet::ParseExcel::Workbook -> Parse ( $workbook ) or warn ( "Problem opening $workbook!\n") ; my $ws = $wb -> Worksheet( $worksheet_name ); foreach my $row ( $ws -> { MinRow } .. $ws -> { MaxRow } ) { foreach my $col ( $ws -> { MinCol } .. $ws -> { MaxCol } ) { my $cell = $ws -> { Cells }[ $row ][ $col ]; if ( $cell ) { my $val = $cell -> { Val }; my $value = $cell -> Value; if ( $row == 33 && $col == 13 ) { print "[$row:$col] = $val\n"; print "[$row:$col] = $value\n"; } } } }

      This was the output:
      [33:13] = -4.1 [33:13] = (-4.10)
      As you can see, I was unable to reproduce the problem you are having. Are you using the latest version of Spreadsheet::ParseExcel?
        Hi
        Thank you for the response.
        I am using the following versions.
        Spreadsheet-ParseExcel-0.33
        Spreadsheet-ParseExcel-Simple-1.04
        But I dont have the Data::Dumper::Simple module installed. Please confirm your versions.
        Thanks for your time.