Created attachment 130967 [details] Petro-grades-05-05b.ods spreadsheet containing VBA macros linked to controls. BRAVO for improving VBA support in LO! But: Procedure to reproduce bug: 1) Open spreadsheet containing VBA code linked to controls. 2) Macro code works 3) Save to .ods 4) Macro code still works properly 5) Save to .xls 6) Macro assignment to controls is not saved. Controls still work, macros still work, macros can be re-assigned to their buttons, but cannot be saved to .xls. This is critical functionality, as many of my colleagues do not have LO and need the xls format. enclosed are three filed: Petro-grades-05-05b.ods spreadsheet containing VBA macros linked to controls. Petro-grades-05-05c.ods (saved from LO) Macro buttons work Petro-grades-05-05c.xls (saved from LO) Macro buttons don't work, macros do. Recommendation: Save macro assignments to controls in xls export.
Created attachment 130968 [details] Petro-grades-05-05c.ods (saved from LO) Macro buttons work
Created attachment 130969 [details] Petro-grades-05-05c.xls (saved from LO) Macro buttons don't work, macros do.
Note: Student data has been faked!
Reproduced. Arch Linux 64-bit, KDE Plasma 5 Version: 5.4.0.0.alpha0+ Build ID: ac8197327d3ef4f3c94fb0746393863404df086b CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: kde4; Locale: fi-FI (fi_FI.UTF-8); Calc: group Built on February 11th 2016
So I think this can be made an Easy Hack and I'm willing to mentor the task. The first step will be to analyze the existing xls files with oletoy (https://github.com/renyxa/re-lab/tree/master/oletoy). Document your findings in this bug report explaining how macros are connected to to elements. The code for the xls export that will need to be adapted is in sc/source/filter/excel. Most likely we should adapt the XLSX export at the same time which shares significant parts of the export code.
Original poster here: Verifying that the behavior still exists in 5.3.4.2. It's a shame because the xls format is much more portable between platforms than xlsx.
BUMP for 5.4.2.2. Bug verified in this version. Please somebody take action.
Created attachment 143592 [details] The same case in a docm file The same case in a docm file (created with MS-WORD 2016), if we import or export with LibreOffice Writer.
*** Bug 142073 has been marked as a duplicate of this bug. ***
Going from ODS to XLS should not really be expected to work. For that, we have bug 139938. Making the case that we should be able to go from XLS to ODS (and back again - or to XLSM) might be more reasonable. Probably this bug report should focus on that aspect. Repro 7.5+ with DOCM using comment 8's attachment 143592 [details]. (Also repro with "Disable VBA refactoring" extension.)
Wow - macros don't even exist when saved in XLS format, and this is flagged as an easyHack? After 6 years I would fear to have to tackle this... Sounds more like a google summer of code project than an easy-hack.