I am using Excel 2010. I am opening test.xls file from VBS (VB script) using the below code:
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("E:\test\test.xls")
objExcel.Application.Visible = True
the workbook test.xls opens fine, but the workbook_open macro that I put inside Thisworkbook Module:
Private Sub Workbook_Open()
MsgBox "Hello"
End Sub
doesn't run.
It works when I open test.xls directly, but not through VB Script.
I have set Developer > Macro Security > Macro Settings to Enable all Macros, but this still doesn't help.