How to Run VBA in OpenOffice

by Chris Hoffman

OpenOffice includes limited support for Visual Basic for Applications (VBA) macros, which was first introduced in OpenOffice 3.0. VBA macros are commonly used with Microsoft Office and embedded in Excel spreadsheets. While OpenOffice doesn’t support all VBA features, it can run many macros with no modification required. All macros except signed macros from trusted sources are disabled in OpenOffice by default, so you’ll need to adjust your macro security settings before running VBA macros or any other type of macros.

1

Click the “Tools” menu at the top of the OpenOffice window and select “Options.”

2

Click “Security” under "OpenOffice.org" at the left side of the "Options" window.

3

Click the “Macro Security” button.

4

Select the “Medium” security level and click “OK” twice.

5

Click the “File” menu, click “Open,” navigate to a file containing a VBA macro and double-click it.

6

Click the “Enable Macros” button.

7

Use the file normally; OpenOffice automatically runs macros with no modification if it supports them. You can also try to run a specific macro in the file by clicking the “Tools” menu, pointing to “Macros,” selecting a VBA macro in the current file and clicking the “Run” button.

Tip

  • check Update to a more recent version of OpenOffice or LibreOffice if your VBA macro doesn’t run. Newer versions may include bug fixes and support for additional VBA features.

Warning

  • close Macros are a security risk and may contain viruses or other harmful code. Only run VBA macros from sources you trust.

About the Author

Chris Hoffman is a technology writer and all-around tech geek who writes for PC World, MakeUseOf, and How-To Geek. He's been using Windows since Windows 3.1 was released in 1992.