logo
search
VBA & Macro Problems

How to Save Excel Workbooks as Macro-Free XLSX Files

Muhammad TalhaMuhammad Talha Sep 27, 2026 869 views

Question details

The user wants to save multiple macro-enabled workbooks as macro-free .xlsx files without having to manually change the file type or lose required VBA functionality.

How to Save Excel Workbooks as Macro-Free XLSX Files
Product
Microsoft Excel
Device & OS
not provided
Scenario
Saving workbooks containing VBA macros to a standard file format without triggering constant compatibility warnings.
Observed behavior
Excel displays a warning that VBA content cannot be saved in the macro-free .xlsx format, requiring the user to manually change the format to .xlsm or permanently remove the macros.
Before you start

Determine if you actually need to keep the VBA macros in your final document. Standard .xlsx files strictly forbid macro code for security reasons; if the macros are required for future use, you must use the .xlsm format.

Solution 1Recommended

Save as Macro-Enabled (XLSM) or Remove Macros

This is the standard resolution for handling workbooks that contain VBA code. You must choose between retaining the macros in a compatible format or stripping them out to use the standard XLSX format.

By design, Microsoft Office restricts the standard .xlsx file format from containing any executable VBA macro code. This is a built-in security measure.

If you attempt to save a macro-enabled workbook as an .xlsx file, Excel will prompt a warning. You must either save it as an .xlsm file to preserve functionality or intentionally remove the VBA code.

1
Save as a Macro-Enabled Workbook

To keep your macros, go to File > Save As. In the 'Save as type' dropdown menu, select 'Excel Macro-Enabled Workbook (*.xlsm)' and click Save.

2
Save as a Macro-Free Workbook

To remove the macros and proceed with a standard file, click 'Yes' when Excel asks if you want to continue saving as a macro-free workbook. The VBA code will be permanently deleted from the new .xlsx file.

Save as Macro-Enabled (XLSM) or Remove Macros
Permanent Macro Removal: Clicking 'Yes' to save as a macro-free workbook strips all VBA code permanently. Ensure you have a backup of the original macro-enabled file if you will need the scripts later.
Free Microsoft Office alternative

Seamlessly Manage Your Spreadsheets with WPS Office

Since the limitation of saving macros in .xlsx files is tied to standard OOXML file format rules, dealing with constant save prompts in Microsoft Office can be tedious. WPS Office provides a lightweight, highly compatible, and free alternative that handles all standard Excel formats seamlessly.

  1. 1. Download and Install: Download WPS Office for free from the official website and run the quick installation.
  2. 2. Open Your Workbooks: Open your existing .xlsx or .xlsm files directly in WPS Spreadsheet without worrying about formatting loss.
  3. 3. Save with Ease: Easily manage your VBA scripts and save your workbooks in the exact format you require using the intuitive File menu.
100% compatibility with Microsoft Excel formats, including standard .xlsx and macro-enabled .xlsm files.Free, lightweight alternative that consumes fewer system resources.Familiar user interface ensuring a zero-learning-curve migration from Microsoft Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel say features cannot be saved in macro-free workbooks?

This warning appears because your current workbook contains VBA (Visual Basic for Applications) macros. The standard .xlsx file format is deliberately designed to not support macro code to protect users from malicious scripts. You must use .xlsm to save macros.

What happens if I click 'Yes' to save as a macro-free workbook?

If you click 'Yes', Excel will proceed to save the file as an .xlsx document, but it will permanently delete all VBA macro code from the file. You will not be able to run those macros the next time you open the workbook.

Is it safe to delete the Excel Options registry key?

Yes, provided you delete only the specific 'Options' key related to Excel and you have backed it up first. When you restart Excel, it will automatically regenerate this key with factory default settings, which often resolves unexpected background behaviors.

Can I automatically save all files as .xlsm?

Yes. You can change your default save format by going to File > Options > Save. Under the 'Save workbooks' section, change the 'Save files in this format' dropdown to 'Excel Macro-Enabled Workbook (*.xlsm)'.