[Solved] How can I delete a macro from a document

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Locked
Kees1
Posts: 9
Joined: Mon Dec 05, 2011 11:36 pm

[Solved] How can I delete a macro from a document

Post by Kees1 »

How can I delete a macro from a document?
Every time when I open the (text) document a popup window is telling me that the document contains a macro.
I wish to delete the macro, however I do not find the "delete button"

With EXTRA-MACROS-MANAGE MACROS I already have selected the macro from the library and then in the right column the macronames selected and removed.
But after reopening the document the popup window is still coming back.
I can of course select the securitylevel LOW with EXTRA-OPTIONS_OPEN OFFICE-MACRO SECURITY-SECURITYLEVEL but I do n't like that option.
Last edited by Kees1 on Tue Jan 07, 2020 10:42 pm, edited 1 time in total.
Open Office 4.1.7
Windows 10 64-bits
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How can I delete a macro from a document

Post by John_Ha »

Tools > Macros > Organise Macros > OOBasic. Find it. Delete it.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How can I delete a macro from a document

Post by Zizi64 »

Your signature is:
__________________________________
Open Office 3.3.0 (Build 5967)
Windows XP 32-bits
Are you really using these archaic-old versions?
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.
luigi.zam
Posts: 12
Joined: Thu Jan 02, 2020 4:12 pm

Re: How can I delete a macro from a document

Post by luigi.zam »

If you don't succeed otherwise try ( on a copy file ) to rename it .zip and delete the "basic" directory inside it. Then of course put back the extension
Libreoffice 6,3 - MxLinux 19
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How can I delete a macro from a document

Post by Villeroy »

The subroutines are not in libraries. Subroutines are in modules, modules are in libraries and libraries are embedded in a document or in one of the global containers "My Macros" or "OpenOffice Macros".
In order to get rid of the macro warning, you have to remove all libraries that are not named "Standard" plus all modules from within "Standard". Lib "Standard" is unremovable.
Tools>Macros>Organize>Basic...
Button [Organize...]
Tab "Modules" lets your remove modules from libraries.
Tab "Libraries" lets you remove non-Standard libraries from a chosen document.
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
Kees1
Posts: 9
Joined: Mon Dec 05, 2011 11:36 pm

Re: How can I delete a macro from a document

Post by Kees1 »

Zizi64 wrote:Your signature is:
__________________________________
Open Office 3.3.0 (Build 5967)
Windows XP 32-bits
Are you really using these archaic-old versions?
Thank you for your perception. Signature updated!
Open Office 4.1.7
Windows 10 64-bits
Kees1
Posts: 9
Joined: Mon Dec 05, 2011 11:36 pm

Re: [SOLVED]How can I delete a macro from a document

Post by Kees1 »

Thank you all.
Opening again Tools>Macros>Organize, after checking an item in the (left) library I saw again a button[Remove] and clicked on it.
After checking so all items I reopened the document and the message saying there is a macro in the document stayed away now.
Open Office 4.1.7
Windows 10 64-bits
luigi.zam
Posts: 12
Joined: Thu Jan 02, 2020 4:12 pm

Re: [Solved] How can I delete a macro from a document

Post by luigi.zam »

did you try how I told you to delete the folder "Basic" inside the file? I tried it on a new document and it works. For safety's however, I would advise you if the data is important to use a copy of the file.
Libreoffice 6,3 - MxLinux 19
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] How can I delete a macro from a document

Post by John_Ha »

luigi.zam wrote:did you try how I told you to delete the folder "Basic" inside the file? I tried it on a new document and it works. For safety's however, I would advise you if the data is important to use a copy of the file.
While that does work it is not a supported method. Tools > Macros > Organise Macros > OOBasic ..., is the "proper", supported method.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Kees1
Posts: 9
Joined: Mon Dec 05, 2011 11:36 pm

Re: [Solved] How can I delete a macro from a document

Post by Kees1 »

Fyi.I have followed the supported method as John_Ha has mentioned.
Open Office 4.1.7
Windows 10 64-bits
bluegroper
Posts: 13
Joined: Wed Mar 07, 2018 11:43 am
Location: Somewhere between insomnia and insanity, Au

Re: [Solved] How can I delete a macro from a document

Post by bluegroper »

Another random method that works reliably in my realm.

1. Open the .odt file with the unwanted macro/s.
2. Save as .rtf file. Close all files.
3. Open the .rtf file
4. Save as .odt file. Close all files.
5. Delete the .rtf file.
6. Open the .odt file
7. Macros gone.

HTH
Last edited by bluegroper on Fri Mar 04, 2022 12:17 pm, edited 1 time in total.
LibreOffice 6.x, on BOTH Windoze 10 and CentOS 7 (KDE)
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: [Solved] How can I delete a macro from a document

Post by robleyd »

You forgot one step.

7. Macros gone.
8. Some formatting possibly gone.

See Tutorial] Differences between Writer and MS Word files] for more information.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
bluegroper
Posts: 13
Joined: Wed Mar 07, 2018 11:43 am
Location: Somewhere between insomnia and insanity, Au

Re: [Solved] How can I delete a macro from a document

Post by bluegroper »

I just discovered another way.

1. Open the old.odt file with the unwanted macro/s. Ok the warning.
2. Select ALL contents using alt-A, and alt-C to copy to clipboard.
3. Create a new document. alt-V to paste contents from clipboard.
4. Save as new.odt. Close all files.
5. Open the new.odt file.
6. Macros gone.
7. Formatting preserved.

Dunno why this worked for me. Expect something was screwed up in the old.odt file.
YMMV
LibreOffice 6.x, on BOTH Windoze 10 and CentOS 7 (KDE)
Locked