Why convert XLSX to XLSM?
.XLSX cannot store VBA macros by design - the OOXML spec deliberately separates macro-enabled and macro-free workbook types. If you need button-triggered scripts, custom functions, or event handlers, the workbook must be saved as .XLSM. Excel will prompt you to switch format automatically whenever you try to save a macro into an .xlsx file.
How to convert XLSX to XLSM
Microsoft Excel - Save As BUILT-IN
Open the .xlsx file, press F12 (Windows) or use File > Save As (macOS), then select Excel Macro-Enabled Workbook (.xlsm) from the format list.
LibreOffice Calc - Save As FREE
Open the file in LibreOffice Calc, choose File > Save As, and pick the .xlsm format - note that any VBA macros must be re-authored in Excel to run correctly.
Command line - LibreOffice CLI
Run libreoffice --headless --convert-to xlsm input.xlsx to batch-convert without opening the GUI.
Programs that convert XLSX
About these formats
An XLSX file is a Microsoft Excel spreadsheet saved in the Open XML format, introduced with Excel 2007 as the replacement for the older binary XLS format. You can open it without buying…
Open .XLSX details →An XLSM file is a Microsoft Excel spreadsheet that contains VBA macros - automation code that runs inside the file. Open it in Microsoft Excel (full macro support), LibreOffice Calc, or WPS…
Open .XLSM details →Quality & what to watch
- All spreadsheet content - formulas, charts, pivot tables, named ranges, conditional formatting - carries over unchanged; the conversion only adds the VBA macro container.
- The
.xlsmfile is slightly larger than the source.xlsxbecause thevbaProject.binpart is present even before any macros are written. - Because
.xlsmfiles can run executable code, email clients and antivirus tools flag them more aggressively than.xlsx; Excel keeps macros disabled until you explicitly click "Enable Content".
Frequently asked questions
Do I need to add macros before converting?
.xlsx to .xlsm first and add or record macros later.Can LibreOffice Calc open the converted `.xlsm`?
Will the `.xlsm` file work on macOS Excel?
.xlsm files, but macros that call Windows-specific APIs (shell calls, Win32 functions) will break regardless of format.