logo
search
VBA & Macro Problems

How to Remove the VBA Warning Message When Saving an Excel Workbook

Nimra MalikNimra Malik Oct 10, 2026 869 views

Question details

The user is encountering a persistent warning prompt when attempting to save an Excel workbook after inserting VBA code into it.

How to Remove Warning Messages When Saving an Excel Workbook with VBA
Product
Excel
Device & OS
not provided
Scenario
Saving an Excel spreadsheet that has been recently modified to include VBA macros.
Observed behavior
A warning message appears during the save action, despite the file seemingly being set to the correct format.
Before you start

Carefully read the exact wording of the warning prompt before clicking anything, as it will determine whether the issue is related to a macro-free file extension or a Trust Center privacy setting.

Solution 1Recommended

Save the File as a Macro-Enabled Workbook (.xlsm)

Ensure the workbook is saved in a format that explicitly supports VBA code to avoid the 'VB project cannot be saved in a macro-free workbook' warning.

1
Open Save As Dialog

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

2
Select File Location

Choose 'Browse' to open the file explorer and pick the folder where you want to store the modified workbook.

3
Change File Type

Click the 'Save as type' drop-down menu and select 'Excel Macro-Enabled Workbook (*.xlsm)' from the list of available formats.

4
Save the Workbook

Click the 'Save' button. The macro compatibility warning message should no longer appear.

Save the File as a Macro-Enabled Workbook (.xlsm)
Format Compatibility: Using the .xlsm format guarantees that all VBA modules and macros remain intact and functional when you reopen the file.
WPS Spreadsheet VBA Support

Create and Save Macro-Enabled Workbooks Seamlessly with WPS Office

WPS Spreadsheet provides robust support for writing, running, and saving macro-enabled files. You can easily manage your VBA code without frustrating format compatibility warnings.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your spreadsheet containing the VBA code.
  2. 2. Access the Save Menu: Click the 'Menu' button in the top left corner and select 'Save As'.
  3. 3. Select Macro Format: In the file type dropdown, choose 'Microsoft Excel Macro-Enabled Workbook (*.xlsm)'.
  4. 4. Save Document: Click 'Save' to securely store your macros without encountering formatting warnings.
Fully compatible with Microsoft Excel .xlsm and .xlsb formatsBuilt-in VBA editor for developing and debugging macrosLightweight application with high processing speedFree to download with a highly familiar user interface
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get a warning that VBA features cannot be saved in a macro-free workbook?

This occurs if you attempt to save a document containing VBA macros as a standard .xlsx file. You must change the file format to .xlsm or .xlsb to preserve your code.

Will my VBA code be lost if I ignore the warning and save as .xlsx?

Yes. If you choose to proceed and save the file in a macro-free format (.xlsx), all VBA modules and macros will be permanently stripped from the workbook once it is closed.

Can I permanently disable the Trust Center warning about macros?

While you can adjust macro security in the Trust Center Settings by selecting 'Enable all macros', doing so is not recommended as it leaves your computer vulnerable to malicious code. A safer alternative is to add your working folder to 'Trusted Locations'.