Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

Working with VBA Macros

Visual Basic for Applications (VBA) is an implementation of Microsoft's Visual Basic which is built into all Microsoft Office applications.

Support for VBA is not complete, but it covers a large portion of the common usage patterns. Most macros use a manageable subset of objects in the Excel API (such as the Range, Worksheet, Workbook, etc.) and the support include those objects, and the most commonly used method/properties of those objects.

Loading Microsoft Office documents with executable VBA macros

Choose Tools - Options - Load/Save - VBA Properties and mark the Executable code check box. Then load or open your document.

Executable code

The VBA (Visual Basic for Applications) code will be loaded ready to be executed. If this check box is not marked, the VBA code will be commented out so it can be inspected, but will not run.

After loading the VBA code, Office inserts the statement Option VBASupport 1 in every Basic module to enable a limited support for VBA statements, functions and objects. See Option VBASupport Statement for more information.

Running VBA Macros

Run VBA macros in the same way as Office Basic macros.

Since support for VBA is not complete, you may have to edit the VBA code and complete the missing support with Office Basic objects, statements and functions.

Editing VBA Macros

VBA macros can be edited in the Office Basic IDE.