Save a Marco enables worksheet

Copper Contributor
Hi all I’m using vba to copy a sheet and save as anew workbook it has a couple of Marco in it I’m saving it in code as a xslm file type but it gives me a warning about not being a Marco enabled file type how can I stop the warning?

Kind regards tim
2 Replies

@tim_p70f9 You need to supply the SaveAs method with the correct fileformat:

    ThisWorkbook.SaveAs Filename:="FileName.xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled

 

That’s fab many thanks
Tim