We will be migrating from Ask to Discourse on the first week of August, read the details here

# preserve macro while renaming a calc file

Hi

I think that I understood that macros have to be withing the file structure rather than in my own local LibreOffice Library. Now in my duties I need to share my file with many students. The guys have the tendancy to rename the file (which is normal) therefore loose my macros !!! How can I overcome this ? Thanks in advance for any hint. Moon Attached a screenshot

(edit: activated screenshot)

edit retag close merge delete

Sort by » oldest newest most voted

If you put your macros in a module in the spreadsheet it will not make any difference if the file is renamed, they are in the file.

EDITED 12/05/2018

@moon Your screenshot shows that your macros are in the file Constructeur-V-6-7.ods. I assume that your students are opening the file in LO and not some other program such as Excel. When they send a copy back to you is it as .ods file? In what environments does it not work for you.

I have attached a simple Calc example with a macro that shows a message Box when opened. Check if it works for you and if you send it to your students. C:\fakepath\MacTest.ods

more

Thanks peterwt for the quick reply.

I added in my question a screenshot to better show where my macros stands. In practice, it works when in my own environment (I mean when I copy/past the file), but didn't when opened in various other environments. I checked copies sent back by my students and in fact no trace of the macros. Knowing that the security macro-settings where tuned appropriately.

am I wrong ?

( 2018-05-03 13:34:41 +0200 )edit

Why didn't you answer the question concerning the example .ods by @peterwt ?

I checked copies sent back by my students and in fact no trace of the macros.


If your sent-out file contained the macros, the only explanations inside this universe I can see are that
-1- The students had opened the file with Excel, and saved it again later.
-2- The file had an intermediary existence as .xls or .xlsx.
(One or another student may have reached it out for help to somebody not knowing about the issue.)
-3- Somebody played a trick on you.
Simply denying permission for execution of document macros will only freeze them, but not delete them if LibreOffice was used.

Knowing that the security macro-settings where tuned appropriately.


What setting exactly (Hopefuilly not Low)? Was execution permitted on prompt?
On what system? It's the students that matters if they shall have the macros working.

( 2020-09-03 11:04:55 +0200 )edit