| View previous topic :: View next topic |
| Author |
Message |
Timurlang General User

Joined: 30 Nov 2011 Posts: 8
|
Posted: Thu Feb 23, 2012 4:45 am Post subject: Lost macros after a crash |
|
|
Hi Guys,
I work with WIN XP SP3, OO3.3 Italian.
Following a crash - not caused by OO - after the restore I was asked to register OO again and when I looked at my macros I discovered they had vanished.
All the libraries I had created were no more.
Now, if I look in "C:\Documents and Settings\<user name>\Application Data\OpenOffice.org\3\user\Basic" I can see that they are all still there, all the libraries and modules.
How can I restore them?
I tried to copy the Basic folder in OpenOffice.org3\basis\presets but it did not change anything.
Any suggestion would be welcome. |
|
| Back to top |
|
 |
karolus OOo Advocate

Joined: 22 Jun 2011 Posts: 208
|
Posted: Thu Feb 23, 2012 7:23 am Post subject: |
|
|
Hi
Look inside the subfolders of '...ata\OpenOffice.org\3\user\Basic'.
There must be a file named 'script.xlb' - its Content discribes the content of folder.
Here, for Example the content of script.xlb out of the 'Standard'-folder(e.g. Default ):
| Code: | <?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:element library:name="Module2"/>
<library:element library:name="pythonbr"/>
<library:element library:name="pythonbridge"/>
<library:element library:name="Module4"/>
<library:element library:name="DmBackup"/>
<library:element library:name="DmOptions"/>
<library:element library:name="Module5"/>
<library:element library:name="Module3"/>
</library:library> |
Karo |
|
| Back to top |
|
 |
Timurlang General User

Joined: 30 Nov 2011 Posts: 8
|
Posted: Thu Feb 23, 2012 8:48 am Post subject: |
|
|
Hi Karolus
Yes, each library has its script.xlb
for instance the library "Impulso", which only contains the "CS" module has the following script.xlb:
<?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="Impulso" library:readonly="false" library:passwordprotected="false">
<library:element library:name="CS"/>
</library:library>
(By the way, which program should I use to open an .xlb file? I used OO Word)
Inside the "Impulso" library there il also a "CS.OpenOffice.org 1.1 - File di configurazione" file(containng the module with the macro) and a "dialog.xlb" containig the following:
<?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="Impulso" library:readonly="false" library:passwordprotected="false"/>
However if I go to the Basic folder, there is a script.xlc file which I can't open with OOWord but oddly with OOCalc - hence the strange alignment - which lists:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:libraries PUBLIC -//OpenOffice.org//DTD OfficeDocument 1.0//EN libraries.dtd>
<library:libraries xmlns:library="http://openoffice.org/2000/library" xmlns:xlink="http://www.w3.org/1999/xlink">
<library:library library:name="Standard" library:link="false"/>
</library:libraries>
I see that only the standard library is listed - and it is the only one I can see
Maybe the problem is here.
Any idea? |
|
| Back to top |
|
 |
karolus OOo Advocate

Joined: 22 Jun 2011 Posts: 208
|
Posted: Thu Feb 23, 2012 10:12 am Post subject: |
|
|
Hallo
Try edit the script.xlc in Basic-folder:
| Code: |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:libraries PUBLIC -//OpenOffice.org//DTD OfficeDocument 1.0//EN libraries.dtd>
<library:libraries xmlns:library="http://openoffice.org/2000/library" xmlns:xlink="http://www.w3.org/1999/xlink">
<library:library library:name="Standard" library:link="false"/>
<library:library library:name="impulso" library:link="false"/>
# and so on
</library:libraries>
|
btw.
one line in my 'script.xlc' has the pattern:
| Code: | | <library:library library:name="Standard" xlink:href="$(USER)/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/> |
Karo |
|
| Back to top |
|
 |
Timurlang General User

Joined: 30 Nov 2011 Posts: 8
|
Posted: Thu Feb 23, 2012 11:35 am Post subject: |
|
|
Sorry for the dumb question, but which program should I use to edit those files?
Another question: should I also edit the Basic folder in Programs/OpenOffice.org3/Basis/Presets/Basic ?
It just contains the Standard folder, no mention of the other libraries
Regards
Timurlang |
|
| Back to top |
|
 |
karolus OOo Advocate

Joined: 22 Jun 2011 Posts: 208
|
Posted: Thu Feb 23, 2012 11:56 am Post subject: |
|
|
| Timurlang wrote: | | Sorry for the dumb question, but which program should I use to edit those files? |
a simple Texteditor ( like Wordpad, Notepad, Notepad++ )
| Timurlang wrote: |
Another question: should I also edit the Basic folder in Programs/OpenOffice.org3/Basis/Presets/Basic ?
| No!
Karo |
|
| Back to top |
|
 |
Timurlang General User

Joined: 30 Nov 2011 Posts: 8
|
Posted: Fri Feb 24, 2012 3:44 am Post subject: |
|
|
Problem solved?
I edited the script.xlc as you suggested and it worked - almost.
By the way, after running a macro I had the lines
<library:library library:name="Standard" xlink:href="$(USER)/basic/Standard/script.xlb/" xlink:type="simple" library:link="false"/>
too.
What can you tell me about the Dialog.xlc and .xlb files?
They have no mention of my modules in their rispective libraries.
Is this normal? My macros now work, but I would not like to incour in future problems.
Timurlang |
|
| Back to top |
|
 |
Timurlang General User

Joined: 30 Nov 2011 Posts: 8
|
Posted: Fri Feb 24, 2012 3:46 am Post subject: |
|
|
I wrote that editing the script.xlc file ALMOST solved my problems.
Well, actually OO made a pretty scary thing.
I had installed OO in Italian, later switchin to English for compatibility issues.
When my system crashed and OO was recovered, it re-installed in Italian.
When I ran my macro OO could not make sense of some dates in the macro because of the
language and it reacted by... cancelling those date variables from the Dim list!
That is they were no more defined, they had simply disappeared from the listed variables!
Mercifully they were still in the core of the macro as undefined variables, so after switching
back to English and some Dim-ming everything was fine. |
|
| Back to top |
|
 |
|