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

Ask Your Question

preserve macro while renaming a calc file

asked 2018-05-03 13:12:24 +0200

moon gravatar image

updated 2020-09-03 10:21:07 +0200

Alex Kemp gravatar image


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

C:\fakepath\Screenshot 2018-05-03 13.21.53.png

(edit: activated screenshot)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-05-03 13:19:52 +0200

peterwt gravatar image

updated 2018-05-12 15:18:29 +0200

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

edit flag offensive delete link 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 ?

moon gravatar imagemoon ( 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.

Lupp gravatar imageLupp ( 2020-09-03 11:04:55 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-05-03 13:12:24 +0200

Seen: 92 times

Last updated: Sep 03 '20