Skeeve has asked for the wisdom of the Perl Monks concerning the following question:

Hi! I'm desperately searching for hints as to what could break my Excel::Writer::XLSX created files :(

When I'm running my Dancer based webapp on my local system, everything is fine when it comes to downloading the Excel file created in my webapp using Excel::Writer::XLSX.

But when I access the very same app, using the same strawberry perl, but running on my production system, the resulting files are broken and Excel tells me: (sorry, in german)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/20 +06/main"> <logFileName>error025880_01.xml</logFileName> <summary>Fehler in Datei 'C:\myfile_2014-06-20_15-58-02.xlsx'</sum +mary> <repairedRecords summary="Die folgenden Reparaturen wurden durchge +führt:_x000d__x000a__x000d__x000a_"> <repairedRecord>Reparierte Datensätze: Zellinformationen von / +xl/worksheets/sheet1.xml-Part</repairedRecord> </repairedRecords> </recoveryLog>

Excel could repair - at least it tells me so, but still the data is not exactly as I wrote it. For example the dates are not displayed as YYYY-MM-DD but just as a number.

I'm desperately searching for any hint what could cause the problem or better how to fix it.


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re: Excel::Writer::XLSX files are broken
by Skeeve (Parson) on Jun 20, 2014 at 20:32 UTC

    I think I solved it.

    It's a bug in my code. When writing out the formats to my workbook, I store them in a global hash so not to write a format more than once. Unfortunately (of course) this hash is for every session and so the formats are only written to the very first excel file I create.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e