Ask Your Question
0

how can I make a macro exclusive to one spreadsheet [closed]

asked 2013-08-10 12:25:45 +0100

Zocco gravatar image

I have a large spreadsheet and over the years I have developed a series of macros using BASIC to ease the entry and retrieval of data. However if I load other spreadsheets they detect the presence of these macros and mainly because the sheet automatically runs a macro when loading can give error messages which are not relevant. I am sure there must be a way of isolating macros so that they are only visible to the application for which they are intended. Can anyone help me out with this please.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-06 07:24:07.696678

1 Answer

Sort by » oldest newest most voted
0

answered 2013-08-11 04:14:58 +0100

razon_22 gravatar image

You need to save the macro in your document instead of LibreOffice. Then the macro will only be available when you load that document.

edit flag offensive delete link more

Comments

Thanks for your interest it is much appreciated. I was under the impression that macros are automatically saved when saving the document. I have also saved the Basic manually, directly from the macro editor. The current folder is "my macros & dialogues"> "Standard" > "Module1". I notice that there is a folder with the same name as "my document" which contains a sub folder called "Standard" Do I need to save the macros in this folder and if so will my document find the basic automatically?

Zocco gravatar imageZocco ( 2013-08-12 11:25:37 +0100 )edit

Yes, save it in the Standard folder of your document. When you save the macro to this folder, LibreOffice will create a new module and ask you to name it (Module1 is the default name). Your macro will be saved in Standard > Module1. It will be found by LibreOffice because it is saved inside the spreadsheet file. Some issues: In my testing, even though I gave a macro a specific name, it still is named Main. I found no way to move a macro from LibreOffice to a document. So you may have to save the macro to your spreadsheet and after you're sure it works, remove the macro from the LibreOffice folder so it's not used in other documents.

razon_22 gravatar imagerazon_22 ( 2013-08-12 17:39:18 +0100 )edit

Thanks again, I will do this as soon as I get a few minutes to spare.

Zocco gravatar imageZocco ( 2013-08-13 09:50:07 +0100 )edit

I eventully managed to move my macros (there are many of them so a single macro called "main" will not work) into the" MyDocument"> Standard> Module1 folder. Not a straightforward process, I had to copy and paste. The "Save As" option was greyed out. "MyDocument" insists on looking in the original location in the MyMacros & Dialogues folder. I guess I did not find the correct method to transfer the basic. Is there a way of pointing "MyDocument" to the correct folder?

Zocco gravatar imageZocco ( 2013-08-13 10:52:13 +0100 )edit

Question Tools

2 followers

Stats

Asked: 2013-08-10 12:25:45 +0100

Seen: 783 times

Last updated: Aug 11 '13