How to Fix Excel Save As Macro-Free File Dialog Prompt
Question details
Users need a way to suppress a new confirmation dialog that interrupts automated VBA scripts when saving a macro-enabled workbook as a macro-free file.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Running an automated VBA macro to save a copy of the current workbook in a macro-free format (.xlsx).
- Observed behavior
- A new dialog box appears with 'Save and erase features' and 'Go back' options, which pauses the macro execution instead of silently completing the save process.
Before modifying your script, identify the exact line of code in your VBA editor where the Workbook.SaveAs method is called, as you will need to wrap this statement in alert-suppression commands.
Use Application.DisplayAlerts and Specify File Format in VBA
Suppress the unexpected dialog box by temporarily disabling Excel alerts and explicitly setting the file format to macro-free during the save operation.
By default, Excel prompts the user when saving a macro-enabled workbook (.xlsm) into a macro-free format (.xlsx) to prevent accidental loss of VBA code. Recent Excel updates have changed the appearance of this dialog. To restore automated saving, you must explicitly tell Excel to ignore these warnings and specify the target file format.
Press ALT + F11 in Excel to open the Visual Basic for Applications (VBA) editor.
Find the module and the specific macro that handles the automated file saving.
Insert the line 'Application.DisplayAlerts = False' immediately before your SaveAs command.
Ensure your SaveAs command explicitly defines the macro-free format. For example: 'ActiveWorkbook.SaveAs Filename:="C:\YourPath\File.xlsx", FileFormat:=xlOpenXMLWorkbook'.
Insert the line 'Application.DisplayAlerts = True' immediately after the SaveAs command to restore standard Excel warnings for the rest of your session.

Report the Changed Dialog Behavior to Microsoft
If standard VBA alert suppression does not bypass the new dialog, reporting the issue helps Microsoft identify and fix the disrupted automation behavior.
Try WPS Office for Stable VBA Automation
If unexpected UI changes and new prompts in Microsoft Excel are disrupting your workflows, consider switching to WPS Office. It provides robust spreadsheet capabilities with high compatibility for Microsoft Excel formats and VBA macros, ensuring your automation runs smoothly.
- 1. Download WPS Office: Visit the official WPS website and install the free version of WPS Office.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheets and open your macro-enabled workbook (.xlsm).
- 3. Run Your Macros: Execute your VBA scripts with confidence in a stable, highly compatible environment.

Frequently Asked Questions
Why does my macro suddenly show a save prompt when it didn't before?
Recent updates to Excel have modified how the application handles saving macro-enabled workbooks to macro-free formats. The new 'Save and erase features' dialog is designed to prevent accidental code loss, but it can interrupt automated processes if not handled explicitly in VBA.
What is the correct FileFormat code to save an Excel file without macros?
When using the Workbook.SaveAs method, you should use the constant xlOpenXMLWorkbook (or the numeric value 51) for the FileFormat argument to explicitly save the file as a standard .xlsx workbook.
Does Application.DisplayAlerts = False hide all Excel warnings?
Yes, while a macro is running, setting this property to False suppresses most system prompts and alert messages. Excel automatically selects the default response for these prompts, allowing your macro to continue executing without user intervention.




