Run macros in LibreOffice on Windows
- 1
Open the macro dialog
Tools → Macros → Run Macro. The macro selector opens.
- 2
Select your macro
Browse to your macro in the library tree. Select it and click Run.
Create a macro in LibreOffice Basic
Macro security settings on Windows
By default LibreOffice blocks unsigned macros. To allow macros:
- Tools → Options → LibreOffice → Security → Macro Security
- Set to Medium to ask before running each macro
- Or add trusted file locations: Security → Trusted Sources → File Locations
Macro questions
Do Excel VBA macros work in LibreOffice?
Partially. Simple VBA macros often work because LibreOffice Basic is similar to VBA. Complex macros using Excel-specific objects (Workbook, Application, ActiveX) need rewriting. LibreOffice has a VBA compatibility mode (Tools → Options → LibreOffice Basic → VBA Properties) that improves compatibility for basic VBA code.
LibreOffice macros not running on Windows
Check macro security: Tools → Options → Security → Macro Security. If set to Very High, all macros are blocked. Set to Medium to allow macros with a confirmation prompt. Also check if the file is in a trusted location.