axlsx
axlsx copied to clipboard
Excel repair warning
Hi, I have an issue with excel files generated with the gem. When opening them with Excel 2016 (Windows) or Excel Mac 2011 (Os X), I have the following error when opening the file:
The error log contains the following:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>Repair Result to subscriptions-11_28092016 02466.xml</logFileName><summary>Errors were detected in file 'Macintosh HD:Users:jarod:Downloads:subscriptions-11_28092016.xlsx'</summary><additionalInfo><info>Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.</info></additionalInfo></recoveryLog>
Here is a sample file which generates the problem: subscription-58_28092016.xlsx
The code used to build the file can be found here : https://github.com/LaCasemate/fab-manager/blob/dev/app/views/exports/statistics_current.xlsx.axlsx
I've tried many upgrades/downgrades of the gems (axlsx, rubyzip, axlsx_rails) as I've seen that some similar issues were already reported (eg. #1, #236) but none of them solved the issue.
Note also:
- I was able to open it with LibreOffice 5.1, on Ubuntu without any problem.
- If I choose "Open and Repair", after many warnings, the file opens and contains all the data.
@sylvainbx I did encounter the same issues. Ensure that you're not using unescaped special characters in list names, validation formulas/errors and hints.
Thanks for your hint, @arkadiybutermanov but I don't think this is the problem here: I've tried to generate an empty document (just a workbook with a single sheet with no name and no content) and the problem is still here ...
I am having the same issues when opening excel (2016 in windows) while opening fine with LibreOffice on Ubuntu.
Hi! I had similar issues when having wtong value for defined cell type, e.g. Defined :integer type, but putting there string value.
However, I still get sometimes those broken file errors too, and cannot find why...
Maris
Downgrading rubyzip to 1.0.0 worked for me.
Faced the same problem. Removing few styling (e.g. width = :auto) fixed it for me. PS. m using version 2.1.0-pre
Encountered the same issue and resolved by ensuring the column_types matched cell type for each row.
had the same issue, even after repairing ms excel told that file is corrupt. I didnt set sheet name explicitly, so i think the sheetname was being taken from filename, which had "_". symbol. solved by adding wb.add_worksheet(name: "qwe")