8
votes

The current active workbook is a macro-enabled one.

After performing some automated data manipulation, I want to save it as a new macro-free workbook (thus .xlsx instead of .xlsm). To do this, I recorded and edited a macro:

Dim newFilePath As string
newFileFullName = "C:\List.xlsx"

ActiveWorkbook.SaveAs Filename:=newFileFullName, FileFormat _
:=xlOpenXMLWorkbook, CreateBackup:=False

Workbooks.Open Filename:=newFileFullName
Windows("List.xlsx").Activate

However, whenever I run this macro, a window keeps popping up, asking for confirmation that I want to change the file format.

How can I suppress this pop-up and default it to "Yes"?

1
try to add Application.DisplayAlerts = FalseDmitry Pavliv

1 Answers

13
votes

Add Application.DisplayAlerts = False

Thanks @simoco