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: 100112
Status: open
Priority: 0/
Queue: Spreadsheet-WriteExcel

People
Owner: jmcnamara [...] cpan.org
Requestors: stbaldwin [...] multiservice.com
Cc:
AdminCc:

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



Subject: Bug when creating workbook with file handle
Date: Thu, 6 Nov 2014 15:46:45 +1100
To: bug-Spreadsheet-WriteExcel [...] rt.cpan.org
From: Steve Baldwin <stbaldwin [...] multiservice.com>
Hi, Firstly, thanks for an awesome module !! I've encountered what appears to be a bug when closing a large workbook that was instantiated with a file handle rather than a file name. The problem is really simple to reproduce. Take the bigfile.pl you distribute and change it so that it is using a file handle. I've attached a modified version for your convenience. I'm hoping the attachment makes it into rt. I've tested with the latest CPAN version (2.40). Kind regards, Steve -- ------------------------------------------------------------------ This email is intended solely for the use of the addressee and may contain information that is confidential, proprietary, or both. If you receive this email in error please immediately notify the sender and delete the email.. ------------------------------------------------------------------

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

Subject: Re: Bug when creating workbook with file handle
Date: Thu, 6 Nov 2014 18:43:12 +1100
To: bug-Spreadsheet-WriteExcel [...] rt.cpan.org
From: Steve Baldwin <stbaldwin [...] multiservice.com>
Hi again, I think the following patch resolves the "problem" ... stbaldwin@archer:~/Spreadsheet/WriteExcel$ diff -u /usr/local/share/perl/5.18.2/Spreadsheet/WriteExcel/Workbook.pm . --- /usr/local/share/perl/5.18.2/Spreadsheet/WriteExcel/Workbook.pm 2013-11-07 11:33:18.000000000 +1100 +++ ./Workbook.pm 2014-11-06 18:29:15.790641331 +1100 @@ -1358,7 +1358,8 @@ # Close the filehandle if it was created internally. - return CORE::close($self->{_fh_out}) if $self->{_internal_fh}; + CORE::close($self->{_fh_out}) if $self->{_internal_fh}; + return 1; } else { # File in greater than limit, set $! to "File too large" The problem (from our perspective) is that the _store_OLE_file function is returning undef if the size is > $maxsize and there is no value for $self->{_internal_fh} (i.e. the workbook was instantiated with a file handle). Because we are checking the value returned from $workbook->close, the undef is causing us to assume there was an error. Cheers, Steve On Thu, Nov 6, 2014 at 3:46 PM, Steve Baldwin <stbaldwin@multiservice.com> wrote: Show quoted text
> Hi, > > Firstly, thanks for an awesome module !! > > I've encountered what appears to be a bug when closing a large workbook > that was instantiated with a file handle rather than a file name. > > The problem is really simple to reproduce. Take the bigfile.pl you > distribute and change it so that it is using a file handle. I've attached > a modified version for your convenience. I'm hoping the attachment makes > it into rt. > > I've tested with the latest CPAN version (2.40). > > Kind regards, > > Steve >
-- ------------------------------------------------------------------ This email is intended solely for the use of the addressee and may contain information that is confidential, proprietary, or both. If you receive this email in error please immediately notify the sender and delete the email.. ------------------------------------------------------------------
Hi Steve, Thanks, that looks like a bug. Spreadsheet::WriteExcel is deprecated now in favour on Excel::Writer::XLSX where this issue is resolved. I'll fix this bug but I recommend using Excel::Writer::XLSX instead. See the following: https://metacpan.org/pod/Spreadsheet::WriteExcel#Migrating-to-Excel::Writer::XLSX Regards, John
Subject: Re: [rt.cpan.org #100112] Bug when creating workbook with file handle
Date: Thu, 6 Nov 2014 20:22:38 +1100
To: bug-Spreadsheet-WriteExcel [...] rt.cpan.org
From: Steve Baldwin <stbaldwin [...] multiservice.com>
Thanks a lot for such a quick response John. We are certainly planning on migrating to the new module but just haven't got there yet. Cheers, Steve On Thu, Nov 6, 2014 at 8:15 PM, John McNamara via RT < bug-Spreadsheet-WriteExcel@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100112 > > > Hi Steve, > > Thanks, that looks like a bug. > > Spreadsheet::WriteExcel is deprecated now in favour on Excel::Writer::XLSX > where this issue is resolved. > > I'll fix this bug but I recommend using Excel::Writer::XLSX instead. See > the following: > > > https://metacpan.org/pod/Spreadsheet::WriteExcel#Migrating-to-Excel::Writer::XLSX > > Regards, > > John > > > > >
-- ------------------------------------------------------------------ This email is intended solely for the use of the addressee and may contain information that is confidential, proprietary, or both. If you receive this email in error please immediately notify the sender and delete the email.. ------------------------------------------------------------------
This bug is still present. Unfortunately "migrating to Excel::Writer::XLSX" is not a useful suggestion because that creates XLSX files, not XLS files.