# Run a macro in a particular calc spreadsheet in another machine

Hi ,

I have a macro that needs to be run only when a certain calc spreadsheet is opened . I know that macro written in My Macros and Dialogues is only available in the machine that i'm using . But i would like to open the spreadsheet in another machine and when opened , the macro should run . So how do we embed a macro for a specific spreadsheet so that it runs when the file is opened in another machine ?

edit retag close merge delete

Sort by » oldest newest most voted

Hello,

You haven't stated, but this is based upon the macro being a Basic macro.

From menu, Tools->Macros->Organise Macros->LibreOffice Basic.... This brings up a dialog.

Select your Calc document then click on New. Give it a name (or accept default) and click OK. This brings up the Basic IDE in the standard library embedded in the document. You can place your code there.

Next, from the document menu, Tools->Customise... on the Events tab select Open Document then press Macro... button. Locate the macro embedded in document you want run when the document is opened. Save all steps. Test.

more