https://bugs.documentfoundation.org/show_bug.cgi?id=172748
--- Comment #2 from Neil Roberts <[email protected]> --- Thinking about it a bit more, maybe it makes sense that the macros written from scratch with LibreOffice don’t get saved into xlsm format. Presumably the only reason you would want to save in that format is to give the document to someone using Microsoft Office, but in that case the macros presumably won’t work anyway because they would be written using LibreOffice’s BASIC API. Arguably it’s not true that “no warning is given”, because whenever you save in that format LibreOffice warns you that “this document may contain formatting or content that cannot be saved in the selected file format”. On the other hand it could be interesting to write macros in a new file in VBA compatibility mode and have those saved in xlsm format. Sadly this doesn’t seem to work. Just adding “Option VBASupport 1” at the top of the script doesn’t seem to be enough to make the VBA functions available to the script. However, if you apply the patch from comment #1, save the document and then reload it the VBA API will be available and the macro will work. So maybe an alternative bug to fix would be to add a way to create macros in VBA compatibility mode in a new document. Then the export code would probably correctly handle exporting those and we could just say that it is reasonable not to export macros that are not written in VBA mode. -- You are receiving this mail because: You are the assignee for the bug.
