[Solved] Lost my macros?

Issues with installing under all GNU/Linux Distributions
Post Reply
lapsed librarian
Posts: 39
Joined: Wed Jan 30, 2008 4:18 pm

[Solved] Lost my macros?

Post by lapsed librarian »

Greetings:

On (K)Ubuntu 8.04.

Just installed OO 2.4 on a new machine, and transferred my /home directory to the new machine. I have some very important macros in /home/myusername/.openoffice.org2/user/basic/Standard which I can't figure out how to access. The macros organizer lists My Macros & Dialogs as a likely location for macros, but I have no such directory on my system, nor do I see anyplace in OO's Options to name the path where macros are stored.

Feeling very dumb, because according to Google, no one else seems to have ever asked this question.

Thanks
Last edited by Hagar Delest on Thu Jun 26, 2008 9:20 pm, edited 2 times in total.
Reason: tagged the thread as Solved.
OO 3.2.0 on Linux Mint 9 KDE
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Lost my macros?

Post by Villeroy »

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
lapsed librarian
Posts: 39
Joined: Wed Jan 30, 2008 4:18 pm

Re: Lost my macros?

Post by lapsed librarian »

Hmm... Thanks for this. I searched this forum using "macros" and didn't find that post, but :( it doesn't help.

I have to assume I'm clicking the wrong button someplace.

I do Tools/Macros/OpenOffice/Organize and get a box which contains

My Macros
Standard
Module1

But there's nothing in either Standard or Module1.

When I try to import macros from /home/username/.openoffice.org2/user/basic/Standard/ they're not listed. However, I can certainly see them if I use the file manager. They have .xba extensions, if that makes a difference.
OO 3.2.0 on Linux Mint 9 KDE
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Lost my macros?

Post by Villeroy »

When I create a new "Module3" in library "Standard" of container "My Macros" I get a file
~/.openoffice.org2/user/basic/Standard/Module3.xba
with the following XML-content:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Module3" script:language="StarBasic">REM *****  BASIC  *****

Sub Main
MsgBox "I am a module"
End Sub
</script:module>
The module seems to be registered in
~/.openoffice.org2/user/basic/Standard/script.xlb

Code: Select all

<?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="CELL"/>
 <library:element library:name="Module1"/>
 <library:element library:name="test_"/>
 <library:element library:name="Module2"/>
 <library:element library:name="Module3"/>
</library:library>
Library "Standard" is registered in
~/.openoffice.org2/user/basic/script.xlc which has this single line:

Code: Select all

<library:library library:name="Standard" xlink:href="$(USER)/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/>
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
lapsed librarian
Posts: 39
Joined: Wed Jan 30, 2008 4:18 pm

Re: Lost my macros?

Post by lapsed librarian »

Thanks for the quick reply. I'm on dialup, so I can't check this forum as often as I'd like.
When I create a new "Module3" in library "Standard" of container "My Macros" I get a file
~/.openoffice.org2/user/basic/Standard/Module3.xba...
I got *almost* the same thing. In my case, I created Module2 and now there's a Module1.xba in the directory, which wasn't there before, but no Module2 :?

But I'm still totally stumped as to how I make the macros accessible with Tools/Macros/Run.

Sorry to be such a dork.
OO 3.2.0 on Linux Mint 9 KDE
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Lost my macros?

Post by Villeroy »

So you have some *.xba files, representing the missing modules with all the missing code.
There should be a script.xlb in the same directory. Just add one line for every file module.xba.
<library:element library:name="CELL"/>
registering a module of code in CELL.xba
If you don't have a script.xlb in the same directory as the modules, copy my above script.xlb and register your module names (file names without ".xba").
I think you need to restart the office (mind the nasty quick-starter).
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
lapsed librarian
Posts: 39
Joined: Wed Jan 30, 2008 4:18 pm

Re: Lost my macros?

Post by lapsed librarian »

Yahoo! It worked! Thank you so much! I had to change Module1 and Module2 to the actual macro names, but I just checked and it seems to be working fine.

You're wonderful :D
User avatar
Hagar Delest
Moderator
Posts: 33394
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Lost my macros?

Post by Hagar Delest »

There is something I don't understand: have you put the OOo profile of the old machine in the new one? You should have got back all your previous configuration, including the macros and the shortcuts. Have I missed something?

OK, I see that's solved now but I still wonder!
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
lapsed librarian
Posts: 39
Joined: Wed Jan 30, 2008 4:18 pm

Re: Lost my macros?

Post by lapsed librarian »

Hagar de l'Est wrote:There is something I don't understand: have you put the OOo profile of the old machine in the new one? You should have got back all your previous configuration, including the macros and the shortcuts. Have I missed something?

OK, I see that's solved now but I still wonder!
This came in as I was marking it solved. Shows you how slow dialup can be :-(

Anyway, I figure I must have missed something in the copying, although what I don't know--I didn't transfer everything from my old /home to the new one, and can't check the old machine without doing some serious furniture humping. Frankly, it never occurred to me that I'd missed something, so didn't shift furniture around to set up the old machine to check.

Next time I'll know better, I promise.

And thanks for asking. It may help someone else.
OO 3.2.0 on Linux Mint 9 KDE
Post Reply