Ask Your Question

Removing macros [closed]

asked 2013-03-03 19:46:57 +0100

icb gravatar image

updated 2013-06-16 18:56:57 +0100

manj_k gravatar image

I have a couple of spreadsheets that are distant versions (via "save as..." many times over) of a spreadsheet originally created in MS Excel. When I open the LibreOffice versions, I get a macro warning. Since the spreadsheets don't use macros, I'd like to get rid of the warning. When I go in to Organize Macros, I can see some structure in there but no actual macros to delete, and the delete key is grayed out as well. How can I get rid of all this?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-26 22:17:27.928637


I would have liked to try your solution of saving the spreadsheet as a .fods (plain text) file, but I can't see how to do this in the save as dialog other than as a .cvs file - this is the olny save as text option in there in my version of Calc (LibreOffice Build ID: 350m1(Build:2)).

icb gravatar imageicb ( 2013-03-14 09:45:10 +0100 )edit

The save option is called OpenDocument Spreadsheet (Flat XML) (.fods). It appears 5th on the list of Save as Type options in my LO and LO (and even in OpenOffice 3.2, but further down on the list).

w_whalley gravatar imagew_whalley ( 2013-03-14 14:56:21 +0100 )edit

2 Answers

Sort by » oldest newest most voted

answered 2013-03-14 09:50:47 +0100

icb gravatar image

While playing around with this, I have been able to achieve my desired result by going into Tools|Macros|Organize Dialogs and selecting the libraries tab, then choosing the filename from the location drop down and deleting the library in there (the standard library remains and can't be deleted). After saving and re-opening the spreadsheet, the macro warning no longer appears.

edit flag offensive delete link more


This worked well for me. It is a little bit harder to find now, more like: Tools|Macros|Organize|Libreoffice Basic|Organizer but it seems to have removed the warning.

One detail I would add: if the file is to be saved back to "xls" format you may need to open it and resave it once in LO first otherwise some Excel versions may look for the non existant macro "file" and crash. After I re-saved it this no longer happened.

oliverb gravatar imageoliverb ( 2018-10-26 13:35:08 +0100 )edit

This did not work for me: I found and deleted various things with the organiser, but in the end I was stuck with the ¿module? Standard . Document Objects . Sheet1 with nothing to see there but no way in the organiser to remove it. What I did try from there was Edit, which showed me that this ¿module? contained the code:

Rem Attribute VBA_ModuleType=VBADocumentModule
Option VBASupport 1

I removed that code (but still could not delete the object), did Save in the macro editor, closed that, saved, closed and reopened the document, but it still said it contained macros, and the Sheet1 object was still visible in the organiser. It also now and then seemed to add a Main macro to Sheet1.

The method in W_Whalley’s answer worked, and showed that several more places included the above VBA suport stuff.

PJTraill gravatar imagePJTraill ( 2020-11-16 00:39:33 +0100 )edit

answered 2013-03-04 16:11:43 +0100

w_whalley gravatar image

I don't know of an easy way to get rid of that irksome Macro warning, but try this (on a copy of your file). Save the spreadsheet as a .fods file (plain text). Open the file with a text editor and locate the section starting with <office:scripts>. Delete the code

<ooo:library-embedded ooo:name="Standard"> 
  [several lines of xml and basic code]

and re-save the file.

edit flag offensive delete link more


STELLAR!!! this solved MY problem too!!! should be made permanent part of the ref guide!!!

OldBoricuainLA gravatar imageOldBoricuainLA ( 2013-06-29 23:47:12 +0100 )edit

I finally got around to trying this method - works great! The spreadsheet was too big for Kate to open (more than 65000 lines!) but it was no problem with vi. There were four or five embedded libraries in there.

icb gravatar imageicb ( 2014-09-09 16:34:48 +0100 )edit

thanks man, didn't know about "flat" formats until now :-)

filiprem gravatar imagefiliprem ( 2016-11-29 21:37:18 +0100 )edit

Worked for me in Writer too - saved it as a FODT, then edited it with notepad (using the FIND function to assist!).

Interesting though that the "FLAT" file is 150k when original ODT was 39k???

amips gravatar imageamips ( 2016-12-19 10:05:50 +0100 )edit

Doesn't "FLAT" mean "Uncompressed"?

oliverb gravatar imageoliverb ( 2018-11-01 09:40:41 +0100 )edit

Worked for me too, while the Organiser method did not, as I said in a comment on it.

PJTraill gravatar imagePJTraill ( 2020-11-16 00:41:55 +0100 )edit

Question Tools


Asked: 2013-03-03 19:46:57 +0100

Seen: 11,748 times

Last updated: Mar 14 '13