I know this question has been asked before and I have so far discovered 3 methods, but unfortunately, neither of them work properly.
-
Set up an ‘button’ using a rectangle object and assign a macro to it.
Works, in that it will launch the macro, but the assignment is only valid while the document is still open. When the document is closed and re-opened, the assignment is lost, even when the document is saved. -
=HYPERLINK
Easy enough to set up, but doesn’t seem to work. I have set up the hyperlink as follows:
=HYPERLINK(“vnd.sun.star.script:Standard.Module1.Email1?language=Basic&location=document”,“E-mail”)
This creates a link labelled ‘E-mail’ in a cell, but the link does nothing - and yes, I am doing Ctrl-click. -
Hyperlink icon
I put the above in target and ‘E-mail’ as name, but again, clicking on it does nothing. I can even select ‘Button’ and it creates a nice button, but still does nothing when clicked.
Do I have the path wrong? How does one specify the path then the macro is located under the document name tree rather than the ‘My Macros’ tree?
In addition to the above, is it possible to have the cell that the link/button is in to get focus - or somehow get the row that the button is in - so that I can then base the action on the data in the current row?
Finally, how do I save the macro so that it is included in the spreadsheet document, so that when I move the document to another PC, the macro is still there and I can run it?
Sadly - and please forgive the rant, but it is borne out of sheer frustration - for whatever reason the organization of macros seems to be unnecessarily complex, confusing and it seems, buggy, in LibreOffice. For example, yesterday I had to re-write from scratch some three hours worth of work when I tried to move a macro from one location to another in the LO macro hierarchy and it completely vanished. There is no drag and drop or copy paste, so I had to create a new module and subroutine with the same name in the alternative location and copy and paste, at which point LO crashed. On re-starting the document was recovered but the macro was missing from both locations.
There seems to be no import/export macros either, although I guess one can copy and paste into a text document. As an example of confusion, Tools | Organise Macros | LibreOffice Basic - so we are presumably in the organsier, then there is another Organiser button under this? - Why are these features in a separate dialogue? Why are existing modules not shown on this dialogue? Why can one not re-name modules? Is it possible to put in a polite feature request to have the macro organizer overhauled and streamlined please?