Remove Macros

classic Classic list List threaded Threaded
2 messages Options
SuneOskar SuneOskar
Reply | Threaded
Open this post in threaded view
|

Remove Macros

I can't remove assigned macros from a sheet.
Tools - Customize - Events - Remove - OK doe's not work.

LibreOffice 3.4.3  Mac OS X 10.6.8


Niklas Johansson Niklas Johansson
Reply | Threaded
Open this post in threaded view
|

Re: Remove Macros

I reported it as a bug earlier:
https://bugs.freedesktop.org/show_bug.cgi?id=40651


Until it's fixed you can use a basic macro to remove the event, this one removes an event that starts on document open (OnLoad):

Sub removeEventOnNewDocument()
Dim vListeners
Dim replacementEvent As Variable
    vListeners = ThisComponent.getEvents()
    vListeners.replaceByName("OnLoad", replacementEvent)
End Sub


To know the possible eventnames use this macro.

Sub displayEventNames()
        oEvents = ThisComponent.getEvents()
        For Each oEvent In oEvents.getElementNames
                sTemp = sTemp & oEvent & chr(10)
        Next
        msgbox sTemp
End Sub

I'm sorry it isn't more user friendly (do ask if you don't understand how to use it). At least it gets the job done until the bug is fixed.