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.

i would simply create a Basic Library and put it in an oxt file that has to be deployed in all offices where you want to use your spreadsheet documents. In a network installation you can deploy it once for all users.

In your documents you have easy access to the Basic library. And if your documents are based on templates you can even put the templates together with your Basic library in one oxt bundle. From my pint of view that would be a very clean deployment scenario.

Juergen


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to