Bug 46736 - Add additional text about Macros, when they are present, at warning for saving in non ODF formats, saying that they won't be saved
Summary: Add additional text about Macros, when they are present, at warning for savin...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: Save Macro-VBA
  Show dependency treegraph
 
Reported: 2012-02-28 11:56 UTC by Sophos7
Modified: 2018-09-16 19:24 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
macro working ODS format (10.67 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-02-29 08:57 UTC, Sophos7
Details
macro test file saved as an xls from Calc (6.00 KB, application/xls)
2012-02-29 08:59 UTC, Sophos7
Details
macro test file with macro saved in Excel 2010 (27.50 KB, application/xls)
2012-02-29 09:02 UTC, Sophos7
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sophos7 2012-02-28 11:56:32 UTC
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
Comment 1 Rainer Bielefeld Retired 2012-02-28 21:06:34 UTC
@Sophos7
Please attach a sample document.ods with macro!
Comment 2 Sophos7 2012-02-29 08:57:51 UTC
Created attachment 57820 [details]
macro working ODS format

This is an example file of a macro saved and working in ODS format.
Comment 3 Sophos7 2012-02-29 08:59:33 UTC
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.
Comment 4 Sophos7 2012-02-29 09:02:16 UTC
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.
Comment 5 Sophos7 2012-02-29 09:08:22 UTC
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.
Comment 6 Roman Eisele 2012-09-06 13:14:09 UTC
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.
Comment 7 sasha.libreoffice 2012-12-20 05:30:01 UTC
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
Comment 8 Roman Eisele 2012-12-20 08:42:33 UTC
@ 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.)
Comment 9 Markus Mohrhard 2012-12-20 21:15:09 UTC
(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.
Comment 10 Roman Eisele 2012-12-21 13:27:25 UTC
> 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.
Comment 11 Joel Madero 2014-02-27 23:03:41 UTC
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
Comment 12 Robinson Tryon (qubit) 2015-12-13 11:20:45 UTC Comment hidden (obsolete)