With the fantastic help from the community, yesterday I got a macro working. However, on coming into LO today, it’s disappeared!
I created it in the My Macros Library Container, in the Standard Library, Module1. I edited the Macro called Main and gave it a new name. However, it’s nowhere to be found now.
I’d appreciate any thoughts. I’m using LO 7.4.2 on a MacBook Pro (Catalina).
I know nothing about MacBook, however, did you received a message telling the error when you tried to run the macro?
was it actually saved? Base GUI can be shutdown with LO (e.g macro-editer) still active, at least as background service (on Windows) - i suspect something similar with Mac > is LO started as a service or an application (see LO>options)?
maybe an uncommitted change was lost if iOS silently terminated the LO process before an actual save although LO Recovery should have caught that …?
Hi FelipeAle! It just said the following:
A Scripting Framework error occurred while running the Basic script vnd.sun.star.script:Standard.Module1.PAAB_yellow?language=Basic&location=application.
Message: The following Basic script could not be found:
library: ‘Standard’
module: ‘Module1’
method: ‘PAAB_yellow’
location: ‘application’
I honestly don’t know if it was actually saved. There doesn’t seem to be an option to do that.
Don’t you by chance use safe mode? Sometimes people have problems starting LibreOffice, and end up using Safe Mode every time - but that would use a clean new profile every time, and loose all profile customizations, including non-document macros.
No. I don’t use Safe Mode.
It seems others are having the same issue on macOS: 154570 – LO Writer not saving macros globally on macOS (works in file)
Feel free to CC yourself to that issue to follow the progress (or contribute in the comments there).
Try this…
Go to Tools > Macros > Organizer Macros > Basic
.
.
Then…
Organizer...
button > tab Libraries
and make sure the Location
selected is My Macros & Dialogs
, and click at import button.
.
Now, the part that a don’t know exactly on MacBook. However, on Linux I do this way to find the correct path.
/home/felipe/.config/libreoffice/4/user/basic/Standard/YOUR_SCRIPT.xba
.
.
If you really saved that macro in My Macros & Dialogs Library, it will be there I presume.
I do have a path:
paul/Library/Application Support/LibreOffice/4/user/basic/Standard/
but the only files in it are dialog.xlb, Module1.xba, and script.xlb.
Module1.xba is the module with the code.
Close the office suite, open script.xlb and register Module1 in that file, so it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Standard" library:readonly="false" library:passwordprotected="false">
<library:element library:name="Module1"/>
</library:library>
Hi Villeroy,
I just opened script.xlb and it’s identical to your suggested code.
Curiouser and curiouser!
Whatever the problem is, it’s to do with running LibreOffice on a Mac.
I have an old MacBook running MX Linux and I’ve just used it to create this macro and it works perfectly.
Just guessing: Is LibreOffice allowed to access the profile? MacOS is known to “guard” its users. Checked if LO has “full disk access”, or whatever it is called now…
Hi Wanderer,
I’ve checked and LO does have full disk access.
I think I’ll chuck the Mac and switch to Linux!
I am experiencing a similar issue with macros that do not remain saved after exiting a recent LibreOffice (24.2.3.2) version on a MacBook Pro (Sonoma 14.5).
While trying to access the macro after exiting and restarting LibreOffice, I got the error message in the attached screenshot. It seems that this may provide a clue to the problem, since it lists a user directory that is not mine (perhaps one of the developers?).