Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Spreadsheet-ParseExcel CPAN distribution.

Maintainer(s)' notes

If you are reporting a bug in Spreadsheet::ParseExcel here are some pointers

1) State the issues as clearly and as concisely as possible. A simple program or Excel test file (see below) will often explain the issue better than a lot of text.

2) Provide information on your system, version of perl and module versions. The following program will generate everything that is required. Put this information in your bug report.

    #!/usr/bin/perl -w

    print "\n    Perl version   : $]";
    print "\n    OS name        : $^O";
    print "\n    Module versions: (not all are required)\n";

    my @modules = qw(
                      Spreadsheet::ParseExcel
                      Scalar::Util
                      Unicode::Map
                      Spreadsheet::WriteExcel
                      Parse::RecDescent
                      File::Temp
                      OLE::Storage_Lite
                      IO::Stringy
                    );

    for my $module (@modules) {
        my $version;
        eval "require $module";

        if (not $@) {
            $version = $module->VERSION;
            $version = '(unknown)' if not defined $version;
        }
        else {
            $version = '(not installed)';
        }

        printf "%21s%-24s\t%s\n", "", $module, $version;
    }

    __END__

3) Upgrade to the latest version of Spreadsheet::ParseExcel (or at least test on a system with an upgraded version). The issue you are reporting may already have been fixed.

4) Create a small example program that demonstrates your problem. The program should be as small as possible. A few lines of codes are worth tens of lines of text when trying to describe a bug.

5) Supply an Excel file that demonstrates the problem. This is very important. If the file is big, or contains confidential information, try to reduce it down to the smallest Excel file that represents the issue. If you don't wish to post a file here then send it to me directly: jmcnamara@cpan.org

6) Say if the test file was created by Excel, OpenOffice, Gnumeric or something else. Say which version of that application you used.

7) If you are submitting a patch you should check with the maintainer whether the issue has already been patched or if a fix is in the works. Patches should be accompanied by test cases.

Asking a question

If you would like to ask a more general question there is the Spreadsheet::ParseExcel Google Group.

Report information
The Basics
Id: 39203
Status: open
Priority: 0/
Queue: Spreadsheet-ParseExcel

People
Owner: Nobody in particular
Requestors: Franz.Fasching [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.33
Fixed in: (no value)



Subject: Patch against v0.33 enabling Excel formula parsing and evaluation
(This is *not* a bug report) I put together a small patch against Spreadsheet::ParseExcel v0.33 enabling formula parsing and evaluation. Instructions apply for an installed v0.33: - Make a backup of ParseExcel.pm in case something goes wrong $ cp ParseExcel.pm ParseExcel.pm.orig - Patch Spreadsheet/ParseExcel.pm with the attached diff: $ patch ParseExcel.pm <ParseExcel.pm.diff - Put the attached Formula.pm into the Spreadsheet directory - Test with the attached "spetest formulatest.xls" See Formula.html generated from the module's POD for more information. Use at your own risk, no warranties express or implied. Have fun! -Franz
Subject: spetest
Download spetest
application/octet-stream 2.1k

Message body not shown because it is not plain text.

Subject: Formula.pm

Message body is not shown because it is too large.

Subject: formulatest.xls
Download formulatest.xls
application/vnd.ms-excel 151k

Message body not shown because it is not plain text.

Subject: ParseExcel.pm.diff
555a556,560 > #FFbegin - additional code for formula BIFF parsing > my ($formula_length) = unpack("v", substr($sWk, 20, 2)); > my $formula_hexstring = substr($sWk, 22, $formula_length); > #FFend > 565c570 < Kind => 'Formulra Bool', --- > Kind => 'Formula Bool', # FFcorr 'Formulra' 569a575 > Formula => $formula_hexstring, #FFadd 574c580,596 < else { # Result (Reserve Only) --- > #FFbeg - string formula > elsif ( $iKind==0 ) { > _NewCell ( > $oBook, $iR, $iC, > Kind => 'Formula String', > Val => '', # FFrem - string follows formula tokens! > FormatNo=> $iF, > Format => $oBook->{Format}[$iF], > Numeric => 0, > Formula => $formula_hexstring, #FFadd > Code => undef, #FFrem - set later by _subString() > Book => $oBook, > ); > $oBook->{_PrevPos} = [$iR, $iC, $iF]; > } > #FFend > else { # Result (Reserve Only) 586a609 > Formula => $formula_hexstring, #FFadd 621a645,654 > #FFbeg > if ( defined(my $cell = > $oBook->{Worksheet}[$oBook->{_CurSheet}]->{Cells}[$iR][$iC]) > ) { > # cell already set (probably by a previous string formula) > # just augment with string value > $cell->{Val} = $cell->{_Value} = $sTxt; > $cell->{Code} = $sCode; > } else { > #FFend 631a665 > } #FFadd 1740a1775 > Formula => $rhKey{Formula} || '', #FFadd 1754a1790,1796 > #FFbeg - add formula parsing code > if ( $oCell->{Formula} ) { > push @{$oBook->{Formulae}}, [$oBook->{_CurSheet}, $iR, $iC]; > $oCell->parse_formula($oBook, $oBook->{_CurSheet}, $iR, $iC); > } > #FFend >
Subject: Formula.html

Message body is not shown because it is too large.

On Fri Sep 12 04:38:55 2008, ffasching wrote: Show quoted text
> (This is *not* a bug report) > > I put together a small patch against Spreadsheet::ParseExcel v0.33 > enabling formula parsing and evaluation.
Hi, That is certainly interesting. I'm guessing that this was necessitated by the fact that Spreadsheet::WriteExcel doesn't write the formula value with the formula. Is that correct? Or perhaps you had another requirement. A related project that I would be interested in initiating would be a formula deparser, i.e., something to take a packed ptg expression and convert it to its textual expression (1E 01 00 1E 02 00 1E 03 00 05 03 converted to 1+2*3). This would allow SaveParser to effectively rewrite formulas to WriteExcel. John. --