[Solved] Install macro in My Macros along with an extension

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
Scrumdidlyumptious
Banned
Posts: 8
Joined: Wed Jan 30, 2013 11:30 am

[Solved] Install macro in My Macros along with an extension

Post by Scrumdidlyumptious »

a
Last edited by Scrumdidlyumptious on Thu Feb 14, 2013 8:55 am, edited 2 times in total.
LibreOffice 3.6
Windows 7
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Install a macro in 'My Macros' along with an extension?

Post by B Marcelly »

Yes that is possible.
See Toolbars page of the Developer's Guide. It's rather complex, for simplicity you may use an Extension Packager.
Note that toolbar xml files syntax will change in Apache OpenOffice 4.0 and Extension Packagers are not yet compatible.
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Install a macro in 'My Macros' along with an extension?

Post by Villeroy »

As far as I know, an extension can install Basic libraries. It can not add modules to an already existing library.
Userdefined sheet cell functions such as =MYFUNC(A1:B13;1;C5) need to be saved within library "Standard" in order to be found. The special library named "Standard" always exists even if it is empty. So I believe that you can not install sheet cell functions by extension. An extension package can install your GUI driven macros to any user-defined library (not "Standard") with some unique library name.
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
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: Install a macro in 'My Macros' along with an extension?

Post by B Marcelly »

Villeroy, you are right, but...
Scrumdidlyumptious wrote:I have an extension that adds user defined functions to Calc
From what he said I inferred that its extension exists and works for him, whatever it contains. But maybe he uses the term extension incorrectly. Let us wait.
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
User avatar
Scrumdidlyumptious
Banned
Posts: 8
Joined: Wed Jan 30, 2013 11:30 am

a

Post by Scrumdidlyumptious »

a
Last edited by Scrumdidlyumptious on Thu Feb 14, 2013 8:56 am, edited 1 time in total.
LibreOffice 3.6
Windows 7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Install a macro in 'My Macros' along with an extension?

Post by Villeroy »

Thank you for this important clarification. The vast majority of user defined cell functions are written as simple Basic functions without package, callable from Basic's "Standard" library.

Yes, macros can be distributed through packages too. The only precondition is that the library name must not exist in the global name space. Both "My Macros" and "OpenOffice Macros" are two sections of the same global name space so you can not have library "My Macros"."Tools" since a the office installation comes with a "OpenOffice Macros"."Tools".

For Basic macros there is ...
Tools>Macros>Organize>Basic... button [Organizer...], tab [Libraries]
... where the export button lets you export selected global libraries and document libraries into extension packages. The resulting package should be mergable with your own package. I don't know about any tool to merge extension packages but it merging a Basic package into your own one should be not too hard. Alternatively you may distribute 2 packages.
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
User avatar
Scrumdidlyumptious
Banned
Posts: 8
Joined: Wed Jan 30, 2013 11:30 am

Re: Install a macro in 'My Macros' along with an extension?

Post by Scrumdidlyumptious »

Thank you very much. Exporting allowed me to get the manifest details and an example of how to package it so I could just add the file-entry to my existing package's manifest. The problem was that I didn't know the 'manifest:media-type' for a Basic library but I was searching for the wrong answers on Google. Just for future reference a list of media-types is in the documentation which is probably where I should have checked first: http://wiki.openoffice.org/wiki/Documen ... ile_Format
LibreOffice 3.6
Windows 7
Post Reply