Bug 156465 - save to xls and xlsx files corrupted
Summary: save to xls and xlsx files corrupted
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-Chart XLSX-Corrupted
  Show dependency treegraph
Reported: 2023-07-25 14:50 UTC by Elmar
Modified: 2024-01-05 06:37 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

original source file created by Excel (316.45 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-07-25 14:53 UTC, Elmar
Save orginal excel file to ODS (333.76 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-07-25 14:54 UTC, Elmar
then tried LO v6.4 to save file - it worked as it should (328.53 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-07-25 14:55 UTC, Elmar
the unrecoverable error when opening in Office365 (8.81 KB, image/png)
2023-07-25 14:56 UTC, Elmar
the msg LO v6.4 and v7.4 report (10.58 KB, image/png)
2023-07-25 14:58 UTC, Elmar
xlsx created in excel, opend in LOdev and saved to new name (249.87 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-07-25 20:11 UTC, Elmar
saved using Calc 7.3 (248.59 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-07-25 20:12 UTC, Elmar
xlsx opened in O365 and saved to ODS has error in Calc, and in O365 (355.79 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-07-25 20:13 UTC, Elmar
error that O365 gives (10.29 KB, image/png)
2023-07-25 20:14 UTC, Elmar
Minimized example file (32.83 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-08-07 01:05 UTC, Gabor Kelemen (allotropia)

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar 2023-07-25 14:50:13 UTC
If I save to XLS or XLSX, when open in Excel wants to repair file but is not successful

Steps to Reproduce:
1.opens xlsx in LO
2.save to ODS
3.open in Excel, responds err1.pn
4. open with LO 6-4-7-2 and 7-4-0-0 responds warning err2.png

Actual Results:
gets error Excel cannot repair

Expected Results:
should work

Reproducible: Always

User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-GB
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes

Version: (X86_64) / LibreOffice Community
Build ID: 529dce3d5b695637a1ccc8b4b697d87c5db0d3a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded
Comment 1 Elmar 2023-07-25 14:53:40 UTC
Created attachment 188552 [details]
original source file created by Excel
Comment 2 Elmar 2023-07-25 14:54:31 UTC
Created attachment 188553 [details]
Save orginal excel file to ODS
Comment 3 Elmar 2023-07-25 14:55:39 UTC
Created attachment 188554 [details]
then tried LO v6.4 to save file - it worked as it should
Comment 4 Elmar 2023-07-25 14:56:46 UTC
Created attachment 188555 [details]
the unrecoverable error when opening in Office365
Comment 5 Elmar 2023-07-25 14:58:09 UTC
Created attachment 188556 [details]
the msg LO v6.4 and v7.4 report

note this is a warning, but does not sop opening file
Comment 6 Stéphane Guillou (stragu) 2023-07-25 16:29:00 UTC
Please clarify your steps and the summary/description as they don't match: do you open the ODS or the XLSX in Office 365 and LO?

Regarding the message in LO, this is related to large spreadsheets. It might depend on if you have the experimental "very large spreadsheet" setting turned on in 24.2.

Thank you!
Comment 7 Elmar 2023-07-25 20:11:17 UTC
Created attachment 188564 [details]
xlsx created in excel, opend in LOdev and saved to new name
Comment 8 Elmar 2023-07-25 20:12:08 UTC
Created attachment 188565 [details]
saved using Calc 7.3
Comment 9 Elmar 2023-07-25 20:13:16 UTC
Created attachment 188566 [details]
xlsx opened in O365 and saved to ODS has error in Calc, and in O365
Comment 10 Elmar 2023-07-25 20:14:11 UTC
Created attachment 188567 [details]
error that O365 gives
Comment 11 Elmar 2023-07-25 20:25:30 UTC
This is the way I work:
I have a VM with Win10.
I don't work in Wu=in unless I have to

I have been working with LOdev versions for as long as I can remember - just every now and then I get problems then I revert back to the previous working Dev version.

If someone sends me an xlsx to work with, I will save it as an ODS then when happy will save to xlsx and send to the Win users.

I checked Win and it has opened ODS files up to 17Jul23, since i do not have any ODS files saved to XLSX but the Stable version 7.3 and 7.4 saving to XLSX also give the error in Win

Also note that I saved the T-1...xlsx file in Win to ODS, and when I tried to open the ODS, I got the error that is T-1...png
Comment 12 QA Administrators 2023-07-26 03:14:04 UTC Comment hidden (obsolete)
Comment 13 Elmar 2023-07-26 03:54:39 UTC
I typically download dev on a Tuesday, these were the dates I did, I prefix the zips with upload date:
230607; 230613; 230627; 230703; 230721; 230725 
I delete older ones when when issues I have reported have been resolved.

I also upgrade Linux Mint Cinnamon (LMC) 21.1 to 21.2 on 230718, but reversed that on 24th because of other issues. The download on 21st was thus whilst I was on LMC21.2; and I was working with a colleague who is using Win and that I picked up the problem when she could not open my XLSX.

Then tried out the LO7.3 and found that it did the same.

The LO6.4 example came from a LMC20.1 VM that I created because of having some problems with older versions of some apps.

Not sure if this detail helps.
Comment 14 Gabor Kelemen (allotropia) 2023-08-07 00:39:34 UTC
Confirming in 

Version: (X86_64) / LibreOffice Community
Build ID: 34387332173782498acd4998c7c665d04ebc3c7d
CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded

that ODS attachment 188553 [details] saved to xlsx and opened in Excel gives unreadable content error and repairs it with message: 

Removed Part: /xl/drawings/drawing2.xml part.  (Drawing shape)
Repaired Part: /xl/worksheets/sheet1.xml part. 

The sheet1.xml issue seems to be reproducible by saving either the original xlsx or the ods, with any LO version to xlsx. Tried 3.3, 4.0, 5.0, 6.0, 7.x to 24.2master - all seems to be bad (maybe not for the same reason from Excels point of view, but that's irrelevant in the end). Let's set that aside for a separate report.

The issue with the Drawing shape (there is a chart on a hidden sheet, that seems to be the culprit) begun in 7.3 with:


author	Dennis Francis <dennisfrancis.in@gmail.com>	Thu Sep 02 14:33:55 2021 +0530
committer	Miklos Vajna <vmiklos@collabora.com>	Mon Sep 06 08:47:50 2021 +0200

[API CHANGE] oox: fix import of chart date categories

Adding CC to: Dennis Francis
Comment 15 Gabor Kelemen (allotropia) 2023-08-07 01:05:00 UTC
Created attachment 188816 [details]
Minimized example file
Comment 16 Elmar 2024-01-05 06:37:30 UTC
There was a hidden sheet in the fiile which was a mess, in a workbook received from a colleague.
When I deleted the sheet, everything was fine.

The offending sheet had been created years ago.