Excel Cannot Save a Macro-Enabled Workbook: Fix .xlsm and Macro Settings
Question details
The user needs to save an Excel workbook after enabling or adding a macro.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A workbook contains or uses VBA macros, but Excel does not save it correctly after a macro is enabled.
- Observed behavior
- The workbook cannot be saved as expected, potentially because macros are blocked or the file is being saved in the standard .xlsx format.
Confirm that the workbook contains VBA code and check its current file extension. Only enable macros when the workbook comes from a trusted source.
Save the workbook as an Excel Macro-Enabled Workbook
Use this solution when the workbook contains VBA code and Excel is rejecting or removing the macro during saving.
The standard .xlsx format cannot store VBA projects. Saving a macro-containing workbook as .xlsm preserves the macro code and allows Excel to save it correctly.
In Excel, select File > Save As, then choose Browse if necessary to open the file-saving dialog.
Open the Save as type menu and select Excel Macro-Enabled Workbook (*.xlsm).
Enter a file name, select Save, and choose Yes or Keep the current format if Excel warns that some features cannot be saved in the selected format.
Allow macros through Excel Trust Center settings
Use this solution when macros are disabled and the workbook cannot run or save macro-related changes normally.
Open and save macro-enabled workbooks with WPS Office
WPS Office is a free, lightweight Microsoft Office alternative with a familiar interface and support for common Excel formats. It can help you open, edit, and save compatible workbooks while you migrate from Excel, although VBA macro behavior may depend on the specific macro and WPS support.
- 1. Open the workbook in WPS Spreadsheets: Launch WPS Office, select Spreadsheets, and choose Open to load the Excel workbook.
- 2. Review macro compatibility: Check the workbook's macro-related features and confirm that the required VBA behavior is supported before editing.
- 3. Save in a compatible format: Select Menu > Save As and choose Excel Macro-Enabled Workbook (*.xlsm) when the workbook must retain macro content.

Frequently Asked Questions
Why can’t I save a macro workbook as an .xlsx file?
The .xlsx format does not support VBA projects. Use File > Save As and select Excel Macro-Enabled Workbook (*.xlsm) to preserve the macros.
Where do I enable macros in Excel?
Go to File > Options > Trust Center > Trust Center Settings > Macro Settings, then select the appropriate option for a trusted workbook.
Will changing Macro Settings restore a deleted macro?
No. Macro Settings control whether existing macros can run; they do not restore VBA code removed by saving the file as .xlsx. Check for an earlier .xlsm copy if the code was removed.
What should I do if Excel still will not save the .xlsm file?
Try File > Save As to a new local .xlsm file, check whether the workbook or folder is read-only, and verify that the file is not open by another program or user.
Can WPS Office open Excel macro-enabled workbooks?
WPS Office can open and save compatible .xlsm files, but individual VBA procedures or Excel-specific features may not work identically. Test the macro behavior before relying on the file.




