Bug 114544 - FILESAVE: Calc duplicates Print Areas when saving as an Excel XLSX file
Summary: FILESAVE: Calc duplicates Print Areas when saving as an Excel XLSX file
Status: CLOSED DUPLICATE of bug 112571
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2017-12-18 20:12 UTC by Todd Slagter
Modified: 2017-12-18 20:50 UTC (History)
0 users

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Todd Slagter 2017-12-18 20:12:45 UTC
When saving a spreadsheet as an XLSX file, Calc duplicates any existing print areas. When checking the underlying XML files, the workbook.xml file contains a duplicate 'definedName' node for each print area.

Steps to Reproduce:
1. Create a new Calc file.
2. Define a new Print Range.
3. Save the file as Microsoft Excel 2007-2013 XML (.xlsx) file.
4. Close and reopen the file.
5. Select Insert -> Defined Name or Expression... and note that the Print Area is listed.
6. Insert some data and save the file (or Save As a new XLSX file).
7. Close and reopen the file.
8. Select Insert -> Defined Name or Expression... and note that there are now two Print Areas listed, one with "_0" appended to the original name.
9. Repeat 6-8 to replicate multiple times.

Actual Results:  
The original Print Area is duplicated every time the file is saved.

Expected Results:
Only the original Print Area will be listed each time the file is saved and reopened.

Reproducible: Always

User Profile Reset: Yes

Additional Info:
I ran into this while trying to read the file in an automated system. In the underlying XML files, the 'definedName' element is duplicated with the same 'name' value, which does not seem to be valid. Excel removes the duplicate when opening the file; LibreOffice Calc appends the "_0" to prevent a duplicate name. While this may only be annoying to those using Calc as a standard user, when parsing the XML the duplicate XML elements create problems.

I tested this with,, and (all x64) - the same problem exists in all of them.

About LibreOffice:
Version: (x64)
Build ID: 92a7159f7e4af62137622921e809f8546db437e5
CPU threads: 8; OS: Windows 6.19; UI render: default; 
Locale: en-US (en_US); Calc: group

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Comment 1 Eike Rathke 2017-12-18 20:49:54 UTC

*** This bug has been marked as a duplicate of bug 112571 ***