M
Matthew Sullivan
Public Sub RunExcelMacroOrSub()
'declare variables
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
'excel application stuff
Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open("YourFullFilePathNameHere")
'run the macro
xlApp.Run "YourMacroOrSubNameHere"
'save file
xlBook.Save
'done
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
End Sub
'declare variables
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
'excel application stuff
Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open("YourFullFilePathNameHere")
'run the macro
xlApp.Run "YourMacroOrSubNameHere"
'save file
xlBook.Save
'done
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
End Sub