The code keeps producing this error
seems to be this line "
xlBook.SaveAs Filename:="Template 1", FileFormat:=xlOpenXMLTemplateMacroEnabled
"
trying to run an external VBS script to open excel file run macro and save as self
Option Explicit
On Error Resume Next
ExcelMacroExample
Sub ExcelMacroExample()
Dim xlApp
Dim xlBook
Set xlApp = CreateObject("Excel.Application")
Set fname = "mac PIW"
Set xlBook = xlApp.Workbooks.Open("C:\Users\14432\Documents\Custom Office Templates\Template 1.xltm")
xlApp.Run "Macro"
xlBook.SaveAs Filename:="Template 1", FileFormat:=xlOpenXMLTemplateMacroEnabled
xlBook.Close
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
End Sub