I am trying to create multiple workbooks using the template of an existing workbook. The existing workbook is saved as .xlsm. When I try to create the new workbooks it is giving me an error. But after runing the code i have a pop up message asking if i want "to continue saving as a macro-free workbook"
If I click No, I have an error saying: Error: Run Time error '1004'. VB projects and XLM sheets cannot be saved in a macro-free workbook.
If I click Yes, I have an error saying: Error: This extension can not be used with the selected file type. I know this is because I have given the extension as .xlsm for the new workbooks and will need to change it to .xlsx if I want it to be saved as macro-free workbook.
Sub vba_create_workbook()
Workbooks.Add Template:="Folder Path\File Name.xlsm"
ActiveWorkbook.SaveAs "Folder Path\File Name.xlsm"
Workbooks.Add Template:="Folder Path\File Name.xlsm"
ActiveWorkbook.SaveAs "Folder Path\File Name.xlsm"
End Sub
Is there any way that the new files created can be directly saved as macro-enabled workbooks i.e (.xlsm)?