Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
petr.meduna
in reply to: dibujocad

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