Save a *.xlsm file as *.xlsx and suppress the pop-up

excel, vba

Solution

Add `Application.DisplayAlerts = False`

Thanks @simoco

Problem

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"?

Original source