axlsx icon indicating copy to clipboard operation
axlsx copied to clipboard

Excel repair warning

Open sylvainbx opened this issue 8 years ago • 8 comments

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:

excel2011

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 avatar Sep 28 '16 14:09 sylvainbx

@sylvainbx I did encounter the same issues. Ensure that you're not using unescaped special characters in list names, validation formulas/errors and hints.

arkadiybutermanov avatar Sep 28 '16 16:09 arkadiybutermanov

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 ...

sylvainbx avatar Sep 29 '16 10:09 sylvainbx

I am having the same issues when opening excel (2016 in windows) while opening fine with LibreOffice on Ubuntu.

ying-pbrc avatar Jan 05 '18 16:01 ying-pbrc

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

marisveide avatar Jan 08 '18 22:01 marisveide

Downgrading rubyzip to 1.0.0 worked for me.

bitmaybewise avatar Feb 21 '18 12:02 bitmaybewise

Faced the same problem. Removing few styling (e.g. width = :auto) fixed it for me. PS. m using version 2.1.0-pre

waqar-baig avatar Apr 05 '18 11:04 waqar-baig

Encountered the same issue and resolved by ensuring the column_types matched cell type for each row.

patec avatar May 01 '18 23:05 patec

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")

Legomegger avatar Mar 12 '21 11:03 Legomegger