<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - FILESAVE XLSX New named range is created every time an Excel made spreadsheet that contains print ranges is saved as XLSX"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=112571#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - FILESAVE XLSX New named range is created every time an Excel made spreadsheet that contains print ranges is saved as XLSX"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=112571">bug 112571</a>
from <span class="vcard"><a class="email" href="mailto:baron@caesar.elte.hu" title="Aron Budea <baron@caesar.elte.hu>"> <span class="fn">Aron Budea</span></a>
</span></b>
<pre>The main issue is that eg. print area is exported once as a built-in name:
void XclExpNameManagerImpl::CreateBuiltInNames()
<a href="https://opengrok.libreoffice.org/xref/core/sc/source/filter/excel/xename.cxx#575">https://opengrok.libreoffice.org/xref/core/sc/source/filter/excel/xename.cxx#575</a>
...and then as a user name as well (as many as there were). This is why after
each save there's one extra range. A set of "_0"-s are added during import to
avoid clash.
This is what the named range in xl\worksheets.xml looks like after one save
(different sample than the attachment, the range is different), at this point
the names are still clashing:
<definedNames>
<definedName function="false" hidden="false" localSheetId="0"
name="_xlnm.Print_Area" vbProcedure="false">Sheet1!$A$1:$E$5</definedName>
<definedName function="false" hidden="false" localSheetId="0"
name="_xlnm.Print_Area"
vbProcedure="false">Sheet1!$A$1:$E$5</definedName></definedNames>
Note how in XclExpNameManagerImpl::CreateBuiltInNames() other built-in names
are created as well.
The quick fix seems to be to skip adding the user-created names separately if
they match a built-in name. Maybe they shouldn't even be listed among the
user-created names, if it's possible?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>