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 -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Base http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
