How to Fix Excel Cannot Record or Save Macros in an XLSM Workbook
Question details
The user is unable to successfully record or save VBA macros within an Excel workbook, even when attempting to use the XLSM format.

- Product
- Microsoft Excel
- Device & OS
- Windows 10
- Scenario
- Attempting to record a new macro or save an existing macro into an Excel Macro-Enabled Workbook.
- Observed behavior
- Excel fails to record or save the macro, often due to restrictive Trust Center security settings, incorrect file extensions, read-only permissions, or corrupted Office components.
Verify that your storage drive has sufficient free space to save new files and ensure the workbook is not currently locked in Read-Only mode.
Save as an Excel Macro-Enabled Workbook (XLSM)
Standard XLSX files cannot store VBA macro code. You must explicitly save the file in the XLSM format to retain your recorded macros.
By default, Excel saves workbooks in the .xlsx format, which automatically strips out any VBA code or recorded macros upon saving. Switching to the Macro-Enabled format is required.
Click on 'File' in the top left corner of Excel and select 'Save As'.
Click the file format dropdown menu below the file name field and select 'Excel Macro-Enabled Workbook (*.xlsm)'.
Choose your desired storage location, confirm the file name, and click 'Save'.

Adjust Trust Center Macro Settings
Strict security settings in the Trust Center may block Excel from executing or recording macros.
Perform an Online Repair of Office
If settings and formats are correct but macro recording still fails, the Microsoft Office installation itself may be corrupted and require repairing.
Experience Smooth Spreadsheet Operations with WPS Office
If Microsoft Excel repeatedly fails to save files or encounters complex Trust Center errors, consider switching to WPS Office. It provides a lightweight, robust environment for daily spreadsheet tasks without the heavy system overhead.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button.
- 2. Install the Software: Run the downloaded executable file and follow the quick setup wizard.
- 3. Open Your Workbooks: Launch WPS Spreadsheet and seamlessly open your existing Excel files to continue your work.

Frequently Asked Questions
Why does my saved XLSM file have an exclamation mark on its icon?
The exclamation mark is a standard Microsoft Excel design for Macro-Enabled Workbooks (.xlsm). It visually differentiates files that contain VBA macros from standard workbooks, alerting users that executable code is present.
What should I do if a yellow security warning bar appears when opening an XLSM file?
If you trust the source of the file and intend to use its macros, click the 'Enable Content' button on the yellow warning bar. This action bypasses the security block, allowing VBA macros to run and be recorded.
Can low disk space prevent Excel from saving macros?
Yes. If your computer's hard drive or the specific network drive is completely full, Excel will fail to save the workbook or any newly recorded macros. You must free up storage space before saving.




