Bug 139786 - VBA code modified while saving to .xls format - no longer works in Excel
Summary: VBA code modified while saving to .xls format - no longer works in Excel
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.5.1 rc
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.2.0 target:7.1.3 target:7.0.6
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2021-01-20 13:45 UTC by Justin L
Modified: 2021-04-06 10:50 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
disable-vba-refactoring.oxt: a simple extension prevent VBA being changed by LO. Sets VBA - UseExport to false. (4.32 KB, application/vnd.openofficeorg.extension)
2021-01-20 13:45 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2021-01-20 13:45:05 UTC
Created attachment 169051 [details]
disable-vba-refactoring.oxt: a simple extension prevent VBA being changed by LO. Sets VBA - UseExport to false.

If you round-trip attachment 109955 [details] in 6.4, Excel will complain about the VBA code on load.

This was working until LO 6.4 change by author	Serge Krot on 2020-06-09 10:34:32
commit 577dd32b1c4eb0a4cff574fbabca987cb52b831b
    tdf#106181 XLSX export: output form controls

    Prepared general algorithm to ouput form controls into XLSX.
    For now only CHECKBOX is supported with a possibility to
    link withem to any worksheet/cell.

To replicate:
1.) Go to Expert configuration under advanced settings and change Calc - Filter - Import - VBA - UseExport to false.  (This prevents LO from making any changes to the VBA code - which is essential to it still working in Excel.)
2.) Open attachment 109955 [details] (ignore the macros) and save. A dialog box will inform you that no changes were made to the VBA code.
3.) Open the round-tripped file in Microsoft Excel. In 6.3 it only warned once about dangerous code. In 6.4 it warns twice - the second one about unreadable content.

I personally tested with Excel 2010. I also round-tripped using LO 7.2 and the problem still exists in master.
Comment 1 Justin L 2021-01-21 06:43:20 UTC
The problem seems to have come with this line:
    -ImplWriteShape( aObj, rSolverContainer );
    +ImplWriteShape( aObj, rSolverContainer, /*bOOxmlExport=*/true );

and
            // This code is expected to be called only for DOCX format.
-            if (xPropInfo.is() && bOOxmlExport)
+           if (xPropInfo.is())
Comment 2 Justin L 2021-03-31 08:02:38 UTC
I'm disappointed that this bug wasn't even acknowledged.
Proposed fix at http://gerrit.libreoffice.org/c/core/+/113399
Comment 3 Commit Notification 2021-04-02 15:29:48 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a3c5c0f7ce73001adab7475fde1f8ffec4eef48b

tdf#139786 partial revert tdf#106181 XLSX export: output form controls

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2021-04-06 08:31:58 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/4d63b046679539c1e0f5a6f44e87c9420d679f5b

tdf#139786 partial revert tdf#106181 XLSX export: output form controls

It will be available in 7.1.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2021-04-06 10:50:20 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/babd187dfaa5181ddaec6612fb8efe12ac8ed350

tdf#139786 partial revert tdf#106181 XLSX export: output form controls

It will be available in 7.0.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.