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.

Step 1

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

Step 2

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

Step 3

Click the “Macro Security” button.

Step 4

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

Step 5

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

Step 6

Click the “Enable Macros” button.

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.


  • 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.


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

More Articles