Operation Manual
Caution
LibreOffice allows you to import libraries into a library container, but it will not allow you
to overwrite the library named Standard. Therefore, if you store your macros in the
Standard library, you cannot import them into another library container.
Just as it makes good sense to give your libraries meaningful names, it is prudent to use
meaningful names for your modules. By default, LibreOffice uses names such as Module1,
Module2 and so on.
As you create your macros, you must decide where to store them. Storing a macro in a document
is useful if the document will be shared and you want the macro to be included with the document.
Macros stored in the application library container named My Macros, however, are globally
available to all documents.
Macros are not available until the library that contains them is loaded. The Standard library and
Template library, however, are automatically loaded. A loaded library is displayed differently from a
library that is not loaded. To load the library and the modules it contains, double-click on the library.
Where are macros stored?
LibreOffice stores user-specific data in a directory in the home directory for each user. The location
is operating system specific. Go to Tools > Options > LibreOffice > Paths on the main menu bar
to view where other configuration data are stored. For example, on computer running Windows XP,
this is C:\Documents and Settings\<user name>\Application Data. User macros are
stored in LibreOffice\4\user\basic. Each library is stored in its own directory off the basic
directory.
For casual use, it is not necessary to understand where macros are stored. If you know where they
are stored, however, you can create a backup, share your macros, or inspect them if there is an
error.
Go to Tools > Macros > Organize Dialogs on the main menu bar to open the LibreOffice Macro
Organizer dialog (Figure 333 on page 343). Alternatively, go to Tools > Macros > Organize
Macros > LibreOffice Basic on the main menu bar to open the LibreOffice Macros dialog (Figure
332 on page 343) and then click the Organizer button.
Importing macros
The LibreOffice Macro Organizer dialog allows you to import macro libraries into your document as
well as creating, deleting, and renaming libraries, modules, and dialogs.
1) Select the library container to use and then click Import to import macro libraries (Figure
333 on page 343).
2) Navigate to the directory containing the library to import (Figure 338). There are usually two
files from which to choose, dialog.xlb and script.xlb. It does not matter which of these two
files you select; both will be imported. Macros can be stored in libraries inside LibreOffice
documents. Select a document rather than a directory on disk to import libraries contained
in a document.
Note
You cannot import the library named Standard.
354 | Getting Started with LibreOffice 5.0