[Solved] Need to remove macro from LO Base and Basic
-
- Posts: 21
- Joined: Mon Apr 27, 2020 10:51 pm
[Solved] Need to remove macro from LO Base and Basic
I am trying to remove an old Macro from LO Base. I have already tried to "delete it" but it keeps coming back.
I know people have been complaining about trying to delete Macro's from Documents and Spreadsheets, but have not found any responses about removing it from a database. BTW, yes I did go into the Tools/Macro?Organize and tried to delete it, but that didn't work.
I went into the "config" folder and "basic" subfolder in order to "rename" the "Library" in multiple folders, as a test to locate the files and now it gives me an error, instead of the standard warning about the Macro. Yes, I can go back and rename them back to the original names again to get rid of the errors, but that will not totally remove them.
I also tried creating a brand new database, but still get the same error, which tells me there has to be another file calling it up.
Short of deleting LO and reloading a brand new install or changing to a different Database Program, what are my options to get rid of this Macro?
Thanks for any advise
I know people have been complaining about trying to delete Macro's from Documents and Spreadsheets, but have not found any responses about removing it from a database. BTW, yes I did go into the Tools/Macro?Organize and tried to delete it, but that didn't work.
I went into the "config" folder and "basic" subfolder in order to "rename" the "Library" in multiple folders, as a test to locate the files and now it gives me an error, instead of the standard warning about the Macro. Yes, I can go back and rename them back to the original names again to get rid of the errors, but that will not totally remove them.
I also tried creating a brand new database, but still get the same error, which tells me there has to be another file calling it up.
Short of deleting LO and reloading a brand new install or changing to a different Database Program, what are my options to get rid of this Macro?
Thanks for any advise
Last edited by widowmaker on Wed Jun 10, 2020 2:15 pm, edited 1 time in total.
LibreOffice 6.0.7.3 on Linux Mint 19.3
Re: Need to remove macro from LO Base and Basic
What do you mean by "old Macro"? Where you stored that macro? In a file or in the MyMacros?
If the answer is "in a file", the please upload a problematic Base file here.
If the answer is "in a file", the please upload a problematic Base file here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Need to remove macro from LO Base and Basic
Have you gone to Tools menu/Customise/Events tab and checked there are no macros assigned there - either to save in LibreOffice or save in your document options?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Need to remove macro from LO Base and Basic
I use LO 6.0 (the one which is shipped with Ubuntu 18.4) and have a Base document with
Standard
--> Module1
MyLib
--> Module1
--> Module2
There is no Python or any other code embedded.
I save a copy in a non-trusted filder, open the copy, get the macro warning.
I call the macro organizer, delete Standard.Module1, and the entire "MyLib".
The Basic code is no longer visible.
I save and close the document.
When I open the document again, I get the same macro warning even though the macro organizer does not show any macros and there is no Basic folder nor any Scripts folder in the zip.
LO 7.0(beta) and AOO 4.1.7 show the macro warning when opening the file from a non-trusted directory.
I attach the naked document. It is connected to a local HSQL2 which does not matter in this particular case because we don''t need to access any database.
Standard
--> Module1
MyLib
--> Module1
--> Module2
There is no Python or any other code embedded.
I save a copy in a non-trusted filder, open the copy, get the macro warning.
I call the macro organizer, delete Standard.Module1, and the entire "MyLib".
The Basic code is no longer visible.
I save and close the document.
When I open the document again, I get the same macro warning even though the macro organizer does not show any macros and there is no Basic folder nor any Scripts folder in the zip.
LO 7.0(beta) and AOO 4.1.7 show the macro warning when opening the file from a non-trusted directory.
I attach the naked document. It is connected to a local HSQL2 which does not matter in this particular case because we don''t need to access any database.
- Attachments
-
- Konten.odb
- (8.02 KiB) Downloaded 242 times
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 21
- Joined: Mon Apr 27, 2020 10:51 pm
Re: Need to remove macro from LO Base and Basic
I created the Macro using using Tools > Macros > Organize macros > LibreOffice Basic.Zizi64 wrote:What do you mean by "old Macro"? Where you stored that macro? In a file or in the MyMacros?
If the answer is "in a file", the please upload a problematic Base file here.
The name of the Library is still there below the Standard Library.
The Standard Library has 2 Modules that are both empty or I should say do not display any files.
The Library I created is still there but the modules and contents are not displayed and the EDIT button is grey, so it can not be clicked. Also, I can not change or delete it's name.
However, in spite of no Macros being displayed in these Modules or Libraries, I still kept getting messages stating the document contains Macros.
So I tracked down the location of the Macros and found them in
file:///home/user/,config/libreoffice/4/user/basic/libraryname/script.xlb/:
At that point, I opened the folder containing the same name as the Macro I created and discovered it still contained files. So, instead of deleting the files, I renamed the folder as a test to see if it would eliminate the messages stating the document contained Macros.
After renaming the folder, I kept getting the same message stating the document contained Macros, but then after dismissing that message, I also got a message stating their was an error loading BASIC of the document file:///home/user/,config/libreoffice/4/user/basic/libraryname/script.xlb/:
That led me to one plain fact. Somewhere within LO Base, there is another file that is still calling out the Macro and I am trying to find the location of that file, in order to see if the "call" to the Macro can be deleted.
Thanks
LibreOffice 6.0.7.3 on Linux Mint 19.3
Re: Need to remove macro from LO Base and Basic
Have you looked through your other libraries and modules to see if you can find somewhere within a sub which calls the macro?
One option would be to reinstate the macro but with nothing in it - it will be called and will run successfully but nothing will happen. eg
You can also comment out a macro so nothing runs with ' in front of every line
or put exit sub or exit function if its a function at the start
One option would be to reinstate the macro but with nothing in it - it will be called and will run successfully but nothing will happen. eg
Code: Select all
sub yoursubname()
end sub
Code: Select all
sub yoursubname()
' line of code
' line of code
end sub
Code: Select all
sub yoursubname()
Exit sub
'nothing else will run
end sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 21
- Joined: Mon Apr 27, 2020 10:51 pm
Re: Need to remove macro from LO Base and Basic
Thank you for that information. I will take a look at it.JeJe wrote:Have you looked through your other libraries and modules to see if you can find somewhere within a sub which calls the macro?
One option would be to reinstate the macro but with nothing in it - it will be called and will run successfully but nothing will happen. eg
You can also comment out a macro so nothing runs with ' in front of every lineCode: Select all
sub yoursubname() end sub
or put exit sub or exit function if its a function at the startCode: Select all
sub yoursubname() ' line of code ' line of code end sub
Code: Select all
sub yoursubname() Exit sub 'nothing else will run end sub
In the meantime, I just went into the .config folder and made copies of all the original files and folders in the Basic folder.
I then went into the original dialog.xlc file and the oridinal dialog.xlc file and deleted all lines relating to the Library name I wanted to delete.
I also went into the Standard Folder and deleted the lines calling for the library I wanted to get rid of, and deleted them in the Script.xlb file and the dialog.xlb file.
This got rid of all my errors. However, when I open the database, it still claims I have a Micro in the database somewhere, so my hunt for a hidden file somewhere still exists.
BTW, my goal in eliminating any reference to a Macro is strictly a security issue. I don't want ANY macros to show upin my db at all. That way if I ever get a warning, I will know there is a problem. Since I manage 30+ websites on this particular machine, I can not afford to have any type of virus sneak in through a Macro.
Thanks
LibreOffice 6.0.7.3 on Linux Mint 19.3
-
- Posts: 21
- Joined: Mon Apr 27, 2020 10:51 pm
Re: Need to remove macro from LO Base and Basic
Thank you for that tip about checking the Tools/Customize/Events tab. I had not realized you could check for Assigned Actions in that location.JeJe wrote:Have you gone to Tools menu/Customise/Events tab and checked there are no macros assigned there - either to save in LibreOffice or save in your document options?
As it turned out, I did not have any actions assigned to this database, but at least now I have one more tool to rely on in the future. I appreciate the info.
LibreOffice 6.0.7.3 on Linux Mint 19.3
Re: Need to remove macro from LO Base and Basic
If you know the name of the macro, you could search through the OO User Profile directory, using the computer search, for any file containing the macro name in its content.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Need to remove macro from LO Base and Basic
We still don't know the version of LibreOffice. Is it the 6.0 version that is distributed with Ubuntu/Mint?
Do you get any warnings or error messages? If so what do they say exactly?
We still don't know where the macros are stored. "My Macros" or embedded in the database document. I guess it is the latter.
In the screenshot, MyMacros>Standard is the highlighted one with many modules "Dialog1", "DispatchChars" etc.
Konten.odb>Standard is the one near the bottom with 2 modules "Module1" and "SetFilter".
Konten.odb has a second library "Import" with modules "KontoImport" and "Module1".
In today's posting posting.php?mode=reply&f=20&t=102205#pr493739 I attached a copy of that document where I managed to strip all Basic code, removed all forms and reports with LO 6.0 (Ubuntu) and still get a warning about embedded macros when opening the document with any version of AOO/LO.
Do you get any warnings or error messages? If so what do they say exactly?
We still don't know where the macros are stored. "My Macros" or embedded in the database document. I guess it is the latter.
There is MyMacros>Standard with code modules and there is YourDatabaseDocument.odb.Standard with its own code modules. Is it the Standard library of MyMacros or is it the Standard library within your database document?The name of the Library is still there below the Standard Library.
In the screenshot, MyMacros>Standard is the highlighted one with many modules "Dialog1", "DispatchChars" etc.
Konten.odb>Standard is the one near the bottom with 2 modules "Module1" and "SetFilter".
Konten.odb has a second library "Import" with modules "KontoImport" and "Module1".
In today's posting posting.php?mode=reply&f=20&t=102205#pr493739 I attached a copy of that document where I managed to strip all Basic code, removed all forms and reports with LO 6.0 (Ubuntu) and still get a warning about embedded macros when opening the document with any version of AOO/LO.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 21
- Joined: Mon Apr 27, 2020 10:51 pm
Re: Need to remove macro from LO Base and Basic
Since there are 2 of us trying to get solutions here, i am getting confused by the replies. Anyway, by deleting the files I mentioned in my post above, I am now able to create new databases without getting a message stating they contain macros.RoryOF wrote:If you know the name of the macro, you could search through the OO User Profile directory, using the computer search, for any file containing the macro name in its content.
I am also able to access about 10 old databases without any macros warning messages, however I still have around 20 databases where I am still getting the warning messages stating they contain Macros, when they do not.
What I would like to know now, is where is the file located that sends out the message stating macros exist in a particular database.
Thanks
LibreOffice 6.0.7.3 on Linux Mint 19.3
Re: Need to remove macro from LO Base and Basic
If an error message states, that the document contains macros, then file:///home/user/,config/libreoffice/4/user/basic/libraryname/script.xlb/: is not the place where to search. This is the location of "My Macros". Macros stored in that place are not embedded in any document.
This is why I try to clarify:
Embedded or not?
Which exact warning?
Which exact version of LibreOffice? See menu:Help>About LibreOffice. Since LO 6.4 there are new issues with macros.
-------------------------
The topic reads: "Need to remove macro from LO Base and Basic"
It should be: "Need to remove Basic macro from Base document or from LO"
This is why I try to clarify:
Embedded or not?
Which exact warning?
Which exact version of LibreOffice? See menu:Help>About LibreOffice. Since LO 6.4 there are new issues with macros.
-------------------------
The topic reads: "Need to remove macro from LO Base and Basic"
It should be: "Need to remove Basic macro from Base document or from LO"
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
- MrProgrammer
- Moderator
- Posts: 4908
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Need to remove macro from LO Base and Basic
There are no script files, but a directory exists.Villeroy wrote:There is no Python or any other code embedded. I save a copy in a non-trusted filder, open the copy, get the macro warning. I call the macro organizer, delete Standard.Module1, and the entire "MyLib". The Basic code is no longer visible. I save and close the document. When I open the document again, I get the same macro warning even though the macro organizer does not show any macros and there is no Basic folder nor any Scripts folder in the zip.
Downloads 561 $ cd ~/Downloads
Downloads 562 $ file=Konten.odb
Downloads 563 $ pdir=Scripts/python
Downloads 564 $ unzip -l "$file"
Archive: Konten.odb
Length Date Time Name
--------- ---------- ----- ----
39 06-03-2020 12:14 mimetype
47403 06-03-2020 12:14 settings.xml
23499 06-03-2020 12:14 content.xml
0 06-03-2020 12:14 Scripts/python/
0 06-03-2020 12:14 reports/
0 06-03-2020 12:14 Configurations2/menubar/
0 06-03-2020 12:14 Configurations2/toolpanel/
0 06-03-2020 12:14 Configurations2/floater/
0 06-03-2020 12:14 Configurations2/images/Bitmaps/
0 06-03-2020 12:14 Configurations2/toolbar/
0 06-03-2020 12:14 Configurations2/statusbar/
0 06-03-2020 12:14 Configurations2/accelerator/
0 06-03-2020 12:14 Configurations2/progressbar/
0 06-03-2020 12:14 Configurations2/popupmenu/
0 06-03-2020 12:14 forms/
884 06-03-2020 12:14 META-INF/manifest.xml
--------- -------
71825 16 files
Solution, remove the empty directory from the ZIP archive.
Downloads 565 $ # Remove Scripts/python directory of ZIP file, if empty
Downloads 566 $ unzip -l "$file" "$pdir/?*" || zip -d "$file" "$pdir/"
Archive: Konten.odb
Length Date Time Name
--------- ---------- ----- ----
--------- -------
0 0 files
deleting: Scripts/python/
Then when I open Konten.odb the macro warning no longer appears.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Need to remove macro from LO Base and Basic
Thanks. Once upon a time there used to be a Python macro embedded in that document. After deleting that macro, the empty directory Scripts/python/ remained in the archive. My graphical zip application does not work properly. It does not show the empty Scripts folder. Back to command line where applications are technically mature. My version 6 of unzip is 11 years old. Version 1 was made in 1989.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 21
- Joined: Mon Apr 27, 2020 10:51 pm
Re: Need to remove macro from LO Base and Basic
After deleting the files I mentioned in an earlier post, now when I go to open certain copies of a database, I have some that give me the message “/home////file.odb” “ The document contains document macros.”
When I go to an older version of the same database, I do NOT get any warnings.
I do a backup every night. The first time I received the message claiming there was a micro, has been within the last 5 days, yet I had to go back 30 days to find a file that does not give me the Macro message.
What I am looking for now is the source of the message claiming, ““The document contains document macros.”
I am using LibreOffice Version: 6.0.7.3.
Due to memory problems I do not remember creating the macro, but know I am the one that did it, because it contained my code_id, therefore I am assuming that I made it via the Tools/MyMacros section of LibreOffice Base.
When I go to an older version of the same database, I do NOT get any warnings.
I do a backup every night. The first time I received the message claiming there was a micro, has been within the last 5 days, yet I had to go back 30 days to find a file that does not give me the Macro message.
What I am looking for now is the source of the message claiming, ““The document contains document macros.”
I am using LibreOffice Version: 6.0.7.3.
Due to memory problems I do not remember creating the macro, but know I am the one that did it, because it contained my code_id, therefore I am assuming that I made it via the Tools/MyMacros section of LibreOffice Base.
LibreOffice 6.0.7.3 on Linux Mint 19.3
Re: Need to remove macro from LO Base and Basic
In my database a residual empty Script/python folder was the culprit.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: [Solved] Need to remove macro from LO Base and Basic
Just trying to show a summary of the solution:
This is needed to remove macros stored in OpenOffice.org/Libreoffice (application) not in documents.
0) Open a file manager (with search for contents power) and go to ~/.config/*office/#.#/user, where *office stands for openoffice.org or for libreoffice and #.# stands for current version. In my case, it was: ~/.config/libreoffice/7.3.1/user
1) Search for the name of the macro, in my case, MatricLE.
2) Open one of the xml files, like backenddb.xml, search for the name of the macro, take note of the associated path, in my case $UNO_USER_PACKAGES_CACHE/uno_packages/lu80014al9rr.tmp_
3) In the file manager, browse to the noted path and delete the folder, in my case, lu80014al9rr.tmp_.
This is needed to remove macros stored in OpenOffice.org/Libreoffice (application) not in documents.
0) Open a file manager (with search for contents power) and go to ~/.config/*office/#.#/user, where *office stands for openoffice.org or for libreoffice and #.# stands for current version. In my case, it was: ~/.config/libreoffice/7.3.1/user
1) Search for the name of the macro, in my case, MatricLE.
2) Open one of the xml files, like backenddb.xml, search for the name of the macro, take note of the associated path, in my case $UNO_USER_PACKAGES_CACHE/uno_packages/lu80014al9rr.tmp_
3) In the file manager, browse to the noted path and delete the folder, in my case, lu80014al9rr.tmp_.
Libreoffice on Kubuntu 20.04
OpenOffice on Android 10 (AndrOpenOffice)
OpenOffice on Android 10 (AndrOpenOffice)
Re: [Solved] Need to remove macro from LO Base and Basic
That macro had been installed with an extension. You should remove the extension via Tools>Extension Manager...
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: [Solved] Need to remove macro from LO Base and Basic
I wrote the macro in another computer, exported as BASIC and imported on my current computer. No way to remove it via Extension Manager.
Libreoffice on Kubuntu 20.04
OpenOffice on Android 10 (AndrOpenOffice)
OpenOffice on Android 10 (AndrOpenOffice)