logo
search
VBA & Macro Problems

How to Fix Excel Save As Macro-Free File Dialog Prompt

Elise WilliamsElise Williams Oct 7, 2026 870 views

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.

How to Fix Excel Save As Macro-Free File Dialog Prompt
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 you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press ALT + F11 in Excel to open the Visual Basic for Applications (VBA) editor.

2
Locate the Save Command

Find the module and the specific macro that handles the automated file saving.

3
Disable Display Alerts

Insert the line 'Application.DisplayAlerts = False' immediately before your SaveAs command.

4
Update the SaveAs Method

Ensure your SaveAs command explicitly defines the macro-free format. For example: 'ActiveWorkbook.SaveAs Filename:="C:\YourPath\File.xlsx", FileFormat:=xlOpenXMLWorkbook'.

5
Re-enable Display Alerts

Insert the line 'Application.DisplayAlerts = True' immediately after the SaveAs command to restore standard Excel warnings for the rest of your session.

Use Application.DisplayAlerts and Specify File Format in VBA
Best Practice: Always ensure you set Application.DisplayAlerts back to True. Failing to do so can hide critical error messages or prompts in subsequent tasks.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website and install the free version of WPS Office.
  2. 2. Open Your Spreadsheet: Launch WPS Spreadsheets and open your macro-enabled workbook (.xlsm).
  3. 3. Run Your Macros: Execute your VBA scripts with confidence in a stable, highly compatible environment.
Highly compatible with Microsoft Excel formats (.xlsx, .xls, .xlsm)Stable VBA macro environment without unexpected dialog interruptionsLightweight installation that runs smoothly across various devicesFamiliar user interface ensuring a zero-learning-curve transition
microsoft office alternative - wps office

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.