Calc Guide

a stub with the desired name is stored in the Standard library. The stub
macro loads the library containing the implementation and then calls
the implementation.
1) Use Tools > Macros > Organize Macros > OpenOffice.org
Basic to open the OpenOffice.org Basic Macros dialog. Select the
NumberFive macro and click Edit to open the macro for editing.
Figure 302: Select a macro and click Edit
2) Change the name of NumberFive to NumberFive_Implementation
(see Listing 3).
Listing 3. Change the name of NumberFive to
NumberFive_Implementation
Function NumberFive_Implementation()
NumberFive_Implementation() = 5
End Function
3) In the Basic IDE (see Figure 297), hover the mouse cursor over
the toolbar buttons to display the tool tips. Click the Select
Macro button to open the OpenOffice.org Basic Macros dialog
(see Figure 302).
4) Select the Standard library in the CalcTestMacros document and
click New to create a new module. Enter a meaningful name such
as CalcFunctions and click OK. OOo automatically creates a
macro named Main and opens the module for editing.
5) Create a macro in the Standard library that calls the
implementation function (see Listing 4). The new macro loads the
AuthorsCalcMacros library if it is not already loaded, and then
calls the implementation function.
350 OpenOffice.org 3.x Calc Guide