Problem description: When creating Macro and saving the file as .xls the macro does not save to the document. If the same spreadsheet is saved as .ods the macro saves. I can also create a macro in Excel and save it to .xls then open with Calc. I am able to run this macro. The macro will be on the document and it can be ran till you close the document. If you re-open the document the macro will be missing. Steps to reproduce: 1. Create a macro and save it to the spreadsheet 2. Safe the file and close 3. Open file and look for macro to run Current behavior: The Macro will not appear after re-opening the document. Expected behavior: The macro should appear Platform (if different from the browser): Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
@Sophos7 Please attach a sample document.ods with macro!
Created attachment 57820 [details] macro working ODS format This is an example file of a macro saved and working in ODS format.
Created attachment 57822 [details] macro test file saved as an xls from Calc This is the "macro test" file which was .ods. It was saved as .xls. You can see the the macro is missing from the document.
Created attachment 57823 [details] macro test file with macro saved in Excel 2010 I took the macro test.xls and made a copy. I then opened with Excel 2010. No macros were present. I created the same macro within Excel and saved. This macro will run under Excel and Calc.
Here are example files. I first created a new Calc document and setup a macro along with a button to execute the macro. I saved the file as "macro test.ods". I then did a "save as" and created "macro test.xls". While the document is still open the macro works. Once you close and open the document again the macro is no longer present. I then copied the "macro test.xls" as "macro test - Excel.xls". I opened in Excel and confirmed no macro were listed on the document. I then created a new macro that performs the same task and assigned it to a button. I saved the document and opened it with Calc. The macro is present and runs properly.
I may be missing something, but isn’t this the same issue as in Bug 43137 - "CALC: Unable to save BASIC macro on XLS"? IF it is, then the answer is simple (quoting comment no. 3): > XLS can't store basic macros. There is no way to implement your > feature request. ... and we should mark the present bug report as RESOLVED/DUPLICATE of bug 43137.
Calc not saves macro into xls and xlsx and csv and html formats. It is correct behaviour. But IMHO it should warn user that macro will be lost. Changing this to enhancement about adding warning
@ Markus Mohrhard: Hi Markus, as you have explained in some bug report, “XLS can’t store basic macros. There is no way to implement your feature request.” Now this is (since comment #7) a simple feature/enhancement request just to add some warning telling the user that all his macros will be lost, if he tries to save in .xls/.xlsx/.csv/.html format. IMHO this would be a nice and valuable enhancement, it would save us from more useless bug reports about macros lost in .xls format, and it should be rather easy to implement this. Could you please give it a try? Or, if you don’t want to handle this yourself, could this be filed as an EasyHack? Thank you very much! (Status to NEW, because this is a valid enhancement request now.)
(In reply to comment #8) > @ Markus Mohrhard: > > Hi Markus, > > as you have explained in some bug report, “XLS can’t store basic macros. > There is no way to implement your feature request.” > > > Now this is (since comment #7) a simple feature/enhancement request just to > add some warning telling the user that all his macros will be lost, if he > tries to save in .xls/.xlsx/.csv/.html format. But this indirectly already happens. We explicitly warn the user when saving in any non ODF format that this might cause data loss. I recently got another similar request but if I implement all dialogs where we loose information when we save to another format you end up with dozens of warning dialogs before the document is actually saved. If you get the UX team to find a solution for this problem I'm open to provide code pointers for a solution. > > IMHO this would be a nice and valuable enhancement, it would save us from > more useless bug reports about macros lost in .xls format, and it should be > rather easy to implement this. Could you please give it a try? Or, if you > don’t want to handle this yourself, could this be filed as an EasyHack? > This first needs UX input. IMHO we have already the warning that export to XLS will loose information so this needs a clever UX concept to not overload the user with warning dialogs.
> This first needs UX input. IMHO we have already the warning that export to XLS > will loose information so this needs a clever UX concept to not overload the > user with warning dialogs. A good point! I have to agree, it would be really bad user experience to show two or more alerts to the user when saving a file. The only possible solution I can think of (and which I probably had in mind when recommending this enhancement request) would be just to modify the message of the general warning about data lass in non-ODF file formats. So, instead of just saying, as now (3.6.4): This document may contain formatting or content that cannot be saved in the currently selected file format "...". Use the default ODF file format to be sure that the document is saved correctly. we could add some some more specific hints, in this case: This document may contain formatting or content that cannot be saved in the currently selected file format "...". Especially: • All macros will be lost, because macros are not supported by the "..." file format. This hint should appear only if the current document actually contains some macros, of course. IMHO one could add about 2 or 3 of such special hints without overloading the dialog window. But this is just a sketch of what I had in mind; you are right that discussion in and advise by the UX team would be the way to proceed.
In order to limit the confusion between ProposedEasyHack and EasyHack and to make queries much easier we are changing ProposedEasyHack to NeedsDevEval. Thank you and apologies for the noise
Migrating Whiteboard tags to Keywords: (needsDevEval) [NinjaEdit]
*** Bug 127643 has been marked as a duplicate of this bug. ***