Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^5: Error reading Excel Cell Value

by no21 (Sexton)
on Oct 08, 2008 at 01:34 UTC ( #715888=note: print w/ replies, xml ) Need Help??


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

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?


Comment on Re^5: Error reading Excel Cell Value
Select or Download Code
Re^6: Error reading Excel Cell Value
by sandeep78 (Novice) on Oct 08, 2008 at 02:41 UTC
    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.
      Wow, this is interesting.

      I had Spreadsheet::ParseExcel, version 0.32 installed on my system. So I installed version 0.33, and here is the output from the script in my previous post now:
      [33:13] = 7.42648557919274e+275 [33:13] = 742,648,557,919,274,215,596,480,721,467,753,739,797,881,83 +9,158,032,045,444,744,972,281,248,374,846,048,088,725,564,424,705,059 +,145,840,738,686,965,435,358,755,836,749,146,754,873,675,932,600,092, +125,946,893,868,194,138,671,244,971,437,781,478,579,517,410,099,590,0 +90,026,114,048,017,693,855,644,672,962,827,489,552,711,307,891,602,71 +6,747,903,682,255,045,301,108,736.00
      I'm wondering if this is a bug. You should maybe try reporting this bug on CPAN.


        Looks like a bug in Spreadsheet::ParseExcel 0.33.

        In the _UnpackRKRec() sub in ParseExcel.pm the following lines:

        ... substr($sWk, 3, 1) &= pack('U', $u31); ... substr($lWk, 0, 1) &= pack('U', $u01); ...

        should probably be:

        ... substr($sWk, 3, 1) &= pack('c', $u31); ... substr($lWk, 0, 1) &= pack('c', $u01); ...

        If you'd like to raise a bug report feel free. :-) If not I'll do it when I get a chance.

        Update: Looks like it has already been reported. I added the above there.

        --
        John.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://715888]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-07 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls