11-08-2021
11:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-08-2021
11:23 AM
I'm using this code:
AddReference "Microsoft.Office.Interop.Excel"
Imports Microsoft.Office.Interop.Excel
Class excel
Dim excelApp As Microsoft.Office.Interop.Excel.Application
Dim wb As Workbook
Sub main()
excelApp = CreateObject("Excel.Application")
excelApp.Visible = False
excelApp.DisplayAlerts = False
wb = excelApp.Workbooks.Open("C:\TEMP\ex.xlsm")
excelApp.Run("SomeMacro")
wb.Save
wb.Close()
excelApp.Quit
End Sub
End Class