Created attachment 134646 [details] Original MS Excel file with macros There are in fact 2 issues but very linked. I have an Excel file (xlsm) that I open with Libre Office 4.3.7.2. The file is opened correctly and the simple macro in it work correctly. I save my work in ODS format because LibreOffice 4.3.7.2. can not save it in XLSM format. I have try later with version 5.2.7.2. and I have no problem to save my work with macro in XSLM format. The problem happens only when converting XLSM from ODS. I continue to describe my problem ... After saving my work in an ODS file, I reopen it and all the cells that contains simple CUSTOM macro display a warning message daying that the name of macro not exists !!! In fact, in Original Excel the name is a mix of upper case and lower case and is equal to "NrAlbums". When loaded in LibreOffice the name is converted in "NRALBUMS" and the macro continue to work correclty. After saving the workbook in ODS file and open it again the name in cell's formula is converted "nralbums" where all characters are converter to lowercase. At this moment the macro is not more recognized. This is the problem. The first problem is that the orginal name in CELL is converted in UPPERCASE so that original Microsoft macro name is not kept. The second problem is that when LibreOffice load for a first time the new ODS file, the name is converted from uppercase to lowercase. The name in macro is always unchanged = "NrAblbums" I hope that this can help you to improve LibreOffice! This error is same that Bug ID 74656 but this bug is from 2015 and seems not to be resolved. I have explained why this error occurs and I hope that for this time it will be possible to reproduce it on your development environment. I have attached the original Excel XLSM file to you have the possiblity to test what I have described. Best regards
It seems ok in Version: 5.1.0.0.alpha1+ Build ID: 7289a140fc68dc898ba2b2357cc960968195f236 Threads 4; Ver: 4.8; Render: default; but not in Version: 5.2.0.0.alpha1+ Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; Locale: ca-ES (ca_ES.UTF-8)
I use pc Debian testing x86-64. Wih master sources updated today, i made some tests. 1) xlsm is proposed and I could save a clone of the file in xlsm remark: with Debian package LO 5.3.4, xlsm format is proposed. 2) I could reproduce the fact that when loading xlsm, I've got "NRALBUMS" and when converting in ods and open again, it's "nralbums". other remark: I suppose the xlsm clone must contain "NRALBUMS".
Bibisected to the comment referenced below, using repo bibisect-linux-64-5.2. Adding Cc: to Markus Mohrhard. https://cgit.freedesktop.org/libreoffice/core/commit/?id=e8322dffb4dfc7015ee0842f133b79080eb2b0d8 author Markus Mohrhard <markus.mohrhard@googlemail.com> 2016-04-09 09:36:45 +0200 committer Markus Mohrhard <markus.mohrhard@googlemail.com> 2016-04-09 08:52:30 +0000 import all formatting properties for column style, tdf#96549
Actually this seems to be only partly related to the VBA code itself: 1.) In master and most likely all builds since the VBA export feature, exporting to XLSM works and reimport keeps the formulas. 2.) In master exporting to ODS and reimporting keeps the module and the formula is available but it seems that the formula is compiled before the module has been imported. Using the formula after the import works fine. Basically, this boils down to an import order issue. The bibisect result must be completely wrong. This commit is in a completely different area.
I'll attach simplified test documents.
Created attachment 143691 [details] Simplified XLSM document
Created attachment 143692 [details] Simplified ODS document
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=76bf3939b0583212a56c317c85aea110f8ac6fee related tdf#109132, ugly hack to ensure the VBA mode is setup during import 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.
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9ea6c0e6777c5b367ec507f10858c9c4be5960ed tdf#109132, load VBA library by default during ODF import 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.
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b45926a3a1dd89ffec3ed766ab5647604c23eec0 add test for tdf#109132 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.