Ask Your Question

How can I import a macro *.bas file into calc?

asked 2019-09-05 18:12:59 +0200

LewG2 gravatar image

updated 2019-09-05 18:34:43 +0200

I'm not a programmer. I've used LO for a few years and have macros that make life a lot easier. I record them and then tweak them from various sources on the net.

I installed a new version of calc. From the old version I had exported the macros to a *.bas file, thinking that I would be able to import it. But I don't see how to do that. I have some very old *.odt files with the text, but they're dated.

How can I import that *.bas file?

If I can't import it directly, am I out of luck and have to paste the very old text in, and then update them manually?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2019-09-05 19:04:16 +0200

LewG2 gravatar image

Thank you very much.

I also found the icon in 5.1 that comes with Ubuntu. I clicked the one I've highlighted in yellow, and it let me walk the directories to the *.bas file I wanted. image description

FTR, I installed a new operating system and was starting from scratch with everything, so I had no macros at all.

edit flag offensive delete link more

answered 2019-09-05 18:56:33 +0200

Ratslinger gravatar image

updated 2019-09-05 18:59:21 +0200


Installing a new version of LO should have no effect on macros.

If these macros were in MyMacros they reside within the user profile which should not be affected by installing a new version. If the macros were within a document, they are still there. A new version has nothing to do with individual documents.

However, to answer your question of How can I import that *.bas file?:

  • Create a module for the macro to be placed into. From menu Tools->Macros->Organize Macros->Libre Office Basic then on the following dialog select the library (such as Standard) where to create the module. Then click new & give it a name:

image description

If you already have modules defined in a library, you can add more by using the Organizer... button and add new modules on the Module tab.

  • Now once you have Basic IDE open (will open upon module creation), open the module where the code is to be imported to:

image description

  • Then from menu select File->Import Basic and select your .bas file:

image description

Code should then be in selected module.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-09-05 18:12:59 +0200

Seen: 30 times

Last updated: Sep 05