Created attachment 145818 [details] Sample XLSM The attached Excel XLSM contains a simple function called from a couple of fields. Save it in Calc, and open it in Excel. => Excel opens the file with recovery, after which it claims named range from /xl/workbook.xml has been removed. It appears Calc saves this in /xl/workbook.xml that wasn't in the original, and is removed with the recovery: <definedNames> <definedName function="true" hidden="false" name="TEST" vbProcedure="true"/> </definedNames> After removing these manually, and rezipping the XLSM, the file opens fine in Excel. Observed using LO 6.2.0.0.alpha0+ (2018-10-09, 425af6845ebe066c950b0b63f50563e067485f3e) / Windows 7.
Created attachment 145819 [details] Roundtripped XLSM (corrupted)
Confirm. Version: 6.2.0.0.alpha0+ Build ID: 425af6845ebe066c950b0b63f50563e067485f3e CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win;
The below commit added a noteworthy branching in sc/source/filter/excel/xeformula.cxx here: https://opengrok.libreoffice.org/xref/core/sc/source/filter/excel/xeformula.cxx#1647 Perhaps the same should be replicated for the preceding "case ocMacro:" path. Eike, would that be a reasonable fix in your opinion? I tested the change, and it works fine in this case, but I don't know if there are further implications to worry about. https://cgit.freedesktop.org/libreoffice/core/commit/?id=1162738c6fbd8505ffa27b28118318cc522a5368 author Eike Rathke <erack@redhat.com> 2013-01-24 23:17:00 +0100 committer Eike Rathke <erack@redhat.com> 2013-01-25 00:23:36 +0100 resolved fdo#59819 write correct OOXML function name mapping
A similar change looks ok to me.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4df55ffee791b9fcb4b2f5e6c64ad15b34316faf Resolves: tdf#120689 omit <definedName> for ocMacro in OOXML It will be available in 6.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Pending review https://gerrit.libreoffice.org/62235 for 6-1
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-6-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d6f563b37d8a694c6c1d4c9ef3ba746c7f019517&h=libreoffice-6-1 Resolves: tdf#120689 omit <definedName> for ocMacro in OOXML It will be available in 6.1.4. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verified with LO 6.2.0.0.alpha1+ (2018-11-01, e33424dd887cb1a11a3dba2513ef0f4bf93a6dbe) / Windows 7. Thanks for making the fix, Eike!