Bug 112566 - FILESAVE XLSX Spreadsheets with data validation from external file XLSX export issue when the external file is not present
Summary: FILESAVE XLSX Spreadsheets with data validation from external file XLSX expor...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:xlsx
Depends on:
Blocks: XLSX-Corrupted Cell-Validity
  Show dependency treegraph
 
Reported: 2017-09-22 09:27 UTC by Gabor Kelemen (allotropia)
Modified: 2021-11-30 17:38 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
The source data file. (15.36 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-09-22 09:27 UTC, Gabor Kelemen (allotropia)
Details
The original file created with Microsoft Excel 2013. (15.97 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-09-22 09:27 UTC, Gabor Kelemen (allotropia)
Details
The original file resaved as XLSX with LibreOffice Calc while the source file was still available. (15.41 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-09-22 09:29 UTC, Gabor Kelemen (allotropia)
Details
The original file resaved as XLSX with LibreOffice Calc without the source file being available (this file showcases the bug). (12.54 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-09-22 09:29 UTC, Gabor Kelemen (allotropia)
Details
The original file resaved as XLSX in Microsoft Excel 2013 without the source file being available (for reference). (15.99 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-09-22 09:30 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the original file saved with LO 7 nightly (49.39 KB, image/png)
2020-07-14 13:44 UTC, NISZ LibreOffice Team
Details
Validation in master (69.92 KB, image/png)
2021-11-30 10:16 UTC, Balázs Varga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2017-09-22 09:27:07 UTC
Created attachment 136456 [details]
The source data file.

If an XLSX spreadsheet created with Microsoft Excel 2013 contains data validation from an external XLSX file, and the external file is not present while the spreadsheet is saved as XLSX with LibreOffice Calc, the link to the source file is not retained and the following error message appears when the document is opened in Microsoft Excel 2013:
Removed Records: Named range from /xl/workbook.xml part (Workbook).

Steps to reproduce:
1. Create a new spreadsheet in Microsoft Excel.
2. Add values to a few cells in a column (the attached vsource.xlsx file uses raptors as an example but it should work with other kind of dinosaurs too).
3. Select the cell range that contains the data.
4. Click on the Define Name on the Formulas ribbon.
5. Give a new name to the datarange, e.g.: Raptors.
6. Save the file as vsource.xlsx, but do not close it yet!
7. Create a new spreadsheet in Excel while still keeping the previously created file open.
8. Click on the Define Name on the Formulas ribbon, give it a name (e.g.: RaptorSource) and fill out the “Refers to:” field like this: ='vsource.xlsx'!Raptors
9. Click on the Data Validation button on the Data ribbon.
10. Select the “List” option from the “Allow” drop-down list.
11. Enter the following in the Source field: =RaptorSource
12. Save it as ValidityFromExternalFile-original.xlsx and close the file.
13. Close the vsource.xlsx file.
14. Move the source data file (vsource.xlsx) to a different location.
15. Open the second spreadsheet in LibreOffice Calc and save it as a new XLSX file called ValidityFromExternalFile-LO.xlsx.
16. Open the ValidityFromExternalFile-LO.xlsx file with Microsoft Excel.

Actual results:
The link to the source file is not retained and the following error message appears when the spreadsheet is opened in Microsoft Excel 2013: Removed Records: Named range from /xl/workbook.xml part (Workbook).

Expected results:
The link to the original source file should be retained even if the file is no longer available, and the spreadsheet should open in Excel without an error message.
Comment 1 Gabor Kelemen (allotropia) 2017-09-22 09:27:45 UTC
Created attachment 136457 [details]
The original file created with Microsoft Excel 2013.
Comment 2 Gabor Kelemen (allotropia) 2017-09-22 09:29:18 UTC
Created attachment 136458 [details]
The original file resaved as XLSX with LibreOffice Calc while the source file was still available.
Comment 3 Gabor Kelemen (allotropia) 2017-09-22 09:29:38 UTC
Created attachment 136459 [details]
The original file resaved as XLSX with LibreOffice Calc without the source file being available (this file showcases the bug).
Comment 4 Gabor Kelemen (allotropia) 2017-09-22 09:30:01 UTC
Created attachment 136460 [details]
The original file resaved as XLSX in Microsoft Excel 2013 without the source file being available (for reference).
Comment 5 Aron Budea 2017-10-01 00:35:21 UTC
Confirmed with LO 6.0 daily build (2017-09-28_03:27:43, 0fa21336428b286d69684cfbb7b845f123657041) & 5.4.1.2 / Windows 7.

However, for me it doesn't work if the data source file is present, either. I didn't create my own, though, but used the two files you provided.
Comment 6 QA Administrators 2018-10-02 02:53:32 UTC Comment hidden (obsolete)
Comment 7 NISZ LibreOffice Team 2020-07-14 13:44:09 UTC
Created attachment 163019 [details]
Screenshot of the original file saved with LO 7 nightly

Still happens when attachment #136457 [details] is saved with Calc and the resulting file is opened in Excel:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: f7eff4319be741143f6d8d5e0f2995e3ce46b126
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: CL
Comment 8 Xisco Faulí 2021-03-31 14:01:23 UTC
Dear Tibor Nagy (NISZ),
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assign it back to yourself if you're still working on this.
Comment 9 Balázs Varga 2021-11-30 10:16:07 UTC
Created attachment 176586 [details]
Validation in master

Probably fixed by these commits:

https://gerrit.libreoffice.org/c/core/+/122026

and

https://gerrit.libreoffice.org/c/core/+/123822
Comment 10 Gabor Kelemen (allotropia) 2021-11-30 17:38:58 UTC
(In reply to Balázs Varga from comment #9)
> Created attachment 176586 [details]
> Validation in master
> 
> Probably fixed by these commits:
> 
> https://gerrit.libreoffice.org/c/core/+/122026
> 
> and
> 
> https://gerrit.libreoffice.org/c/core/+/123822

Indeed it was fixed by 

https://git.libreoffice.org/core/+/12ee423c7549ddd2b86dfc3fc6fed2c617dcca7f

tdf#144397 tdf#144636 XLSX: cache external named ranges and their formulas

Now saving the original file does not generate invalid XML error in Excel.