How to Remove the VBA Warning Message When Saving an Excel Workbook
Question details
The user is encountering a persistent warning prompt when attempting to save an Excel workbook after inserting VBA code into it.

- 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.
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.
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.
Click on the 'File' tab in the top left corner of Excel and select 'Save As' from the menu options.
Choose 'Browse' to open the file explorer and pick the folder where you want to store the modified workbook.
Click the 'Save as type' drop-down menu and select 'Excel Macro-Enabled Workbook (*.xlsm)' from the list of available formats.
Click the 'Save' button. The macro compatibility warning message should no longer appear.

Disable Document Inspector Privacy Warnings
If the warning mentions 'Privacy warning: This document contains macros...', you can disable the personal information removal setting in the Trust Center.
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. Open WPS Spreadsheet: Launch WPS Office and open your spreadsheet containing the VBA code.
- 2. Access the Save Menu: Click the 'Menu' button in the top left corner and select 'Save As'.
- 3. Select Macro Format: In the file type dropdown, choose 'Microsoft Excel Macro-Enabled Workbook (*.xlsm)'.
- 4. Save Document: Click 'Save' to securely store your macros without encountering formatting warnings.

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'.




