Skip Menu |

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

Maintainer(s)' notes

If you are reporting a bug in Spreadsheet::WriteExcel 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::WriteExcel
                      Parse::RecDescent
                      File::Temp
                      OLE::Storage_Lite
                      IO::Stringy
                      Spreadsheet::ParseExcel
                      Scalar::Util
                      Unicode::Map
                    );

    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::WriteExcel (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 but complete example program that demonstrates your problem. The program should be as small as possible. At the same time it should be a complete program that generates an Excel file. If the Spreadsheet::WriteExcel section is part of a much larger program then simplify it down to the essentials. Simulate any DB reads with an array.

5) Say if you tested with Excel, OpenOffice, Gnumeric or something else. Say which version of that application you used.

6) If you are submitting a patch you should check with the author 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::WriteExcel Google Group.

Report information
The Basics
Id: 106721
Status: resolved
Priority: 0/
Queue: Spreadsheet-WriteExcel

People
Owner: jmcnamara [...] cpan.org
Requestors: Ross.Youngblood [...] nextest.com
Cc:
AdminCc:

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



Subject: Bug in write_number (only can write to a cell ONE TIME)
Date: Fri, 28 Aug 2015 14:15:57 -0700
To: "bug-Spreadsheet-WriteExcel [...] rt.cpan.org" <bug-Spreadsheet-WriteExcel [...] rt.cpan.org>
From: Ross Youngblood <Ross.Youngblood [...] nextest.com>
Howdy Spreadsheet::WriteExcel fans! I found this awesome exciting bug! I was filling a spreadsheet with background 0.0 data, then going back and updating any cells with new data. Unfortunately that doesn't work. You can only write to a cell ONE TIME only. That's "one ping only Vascilly". [Appropriate Red-October clip for you to run while you ponder working on this bug] https://www.youtube.com/watch?v=jr0JaXfKj68 Module Installed CPAN Reading 'C:\Perl64\cpan\Metadata' Database was generated on Fri, 28 Aug 2015 05:53:24 GMT Spreadsheet::WriteExcel 2.40 2.40 When the Test case "NoSheet.pl" is run, it will create the test case TestCase.xls. It first writes the answer to life, the universe and everything to cell 0,0 (42). Then it attempts to write pi (3.14) to the same cell. In my case. I have No Pie. If you have Pie, then there is no bug, and you can just ignore this submission. However if like me, you get 42, and no pie... this is the bug I see. I had to refactor my code to write each cell only one time. That wasn't too bad... it just took me a few hours to FIND that this was where the problem was. Thanks for an awesome utility.... I'm feeding the output of my perl script to some C++ code built with VisualStudio 6... and it has an ancient OLE interface for .xls. Which is why I am using the older Spreadsheet::WriteExcel scrpt. The newer XLXS module works great(as far as I know), but I dropped back to this module. -Regards Ross Field Applications Teradyne - Nextest Business Unit
Download TestCase.xls
application/vnd.ms-excel 5.5k

Message body not shown because it is not plain text.

Message body is not shown because sender requested not to inline it.

Hi Ross, Thanks for the detailed and entertaining bug report. This is more or less a feature of the Excel xls file format. It allows multiple data for a cell but only displays the first one that it encounters. In order to alert the use to this it gives an ominous, but opaque, warning when you open the file in Excel: "File error: data may be lost". Since one of the goals of Spreadsheet::WriteExcel is performance and low memory usage it doesn't (by default) track all data to ensure that the user isn't overwriting cells and making Excel unhappy. However, if you turn on "compatibility_mode()" it will track the cells and you will see the 3.14 in the cell and Excel won't issue a warning. http://search.cpan.org/dist/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#compatibility_mode%28%29 Regards, John