Frank Schönheit - Sun Microsystems Germany wrote:
Hi Craig,
I have several spreadsheet documents that need to access a common set of
staroffice basic macro routines that cannot be in a user application
specific location (i.e. they cannot be in a user specific 'My Macros' library)
I would like to be able to have the above mentioned spreadsheet documents
simply load a 'module' file (e.g. common_macros.bas) of staroffice basic
macros and then be able to call routines from the loaded set of macros from
within macros in the spreadsheet documents.
Is this possible using staroffice basic?
Never tried it myself (not exactly *this* scenario, that is), but I
think it should be possible.
The Basic libraries are themselves accessible in UNO: There should be a
"BasicLibraries" property at both "ThisComponent" (for the document) and
"GlobalScope" (for application-wider Basic).
You could create a new module within the Basic libs, and load your
common_macros.bas into it from a central location.
Something like
oCommonLib = GlobalScope.BasicLibraries.creatLibrary( "unique_name" )
sModuleContent = ... ' load common_macros.bas from somewhere
oCommonLib.insertByName( "module_name", sModuleContent )
Of course, you need to add some sugar: How to handle the case the
library/module is already there? How to handle updates (i.e. you need
versioning for the common_macros.bas file), and the like.
Ciao
Frank
In AndrewBase.odt, I demonstrate how to create modules. I do not
demonstrate how to call created modules based on the routine names if
given as a string, at least not in that document.
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]