Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

excel

vba

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

like image 310
Mierzen Avatar asked Apr 19 '14 20:04

Mierzen


People also ask

Can you save XLSM as XLSX?

All you have to do is drag and drop the XLSM file, select the desired format, and click on convert. When you are done converting the file, you can download the XLSX file. The files you are converting will be stored in Cloud.

Does saving XLSM as XLSX remove macros?

Saving the Workbook as XLSX file This is the easiest way to remove macros from an Excel workbook! XLS, XLSM, and XLSB are the only Excel file formats that can hold VBA projects or Macros. If you save an Excel workbook as an XLSX file, the Macros in that workbook will be removed.

How do I save an Excel file as XLSM?

In the Save As box, in the Save as type list box, choose Excel Macro-Enabled Workbook (*. xlsm). Click Save.


1 Answers

Add Application.DisplayAlerts = False

Thanks @simoco

like image 148
Mierzen Avatar answered Sep 21 '22 12:09

Mierzen