VBA & Macro Problems

How to Fix Excel Cannot Record or Save Macros in an XLSM Workbook

Algirdas JasaitisAlgirdas Jasaitis Nov 4, 2026 868 views

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.

How to Fix Excel Cannot Record or Save Macros in an XLSM Workbook
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the Save As menu

Click on 'File' in the top left corner of Excel and select 'Save As'.

2
Change the file format

Click the file format dropdown menu below the file name field and select 'Excel Macro-Enabled Workbook (*.xlsm)'.

3
Save the workbook

Choose your desired storage location, confirm the file name, and click 'Save'.

Save as an Excel Macro-Enabled Workbook (XLSM)
Icon Appearance: An XLSM file icon typically displays a small exclamation mark. This is normal and serves to distinguish macro-enabled files from standard workbooks.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install the Software: Run the downloaded executable file and follow the quick setup wizard.
  3. 3. Open Your Workbooks: Launch WPS Spreadsheet and seamlessly open your existing Excel files to continue your work.
Highly compatible with Microsoft Office formats, including .xlsx, .xlsm, and .csvFree to use, fast to install, and requires minimal system resourcesFamiliar ribbon interface ensures zero learning curve for standard Excel usersIncludes powerful built-in PDF editing and data analysis tools
microsoft office alternative - wps office

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.