Dear All,
I do beg your help.
Is there a way to cancel Excel Macro (sub Workbook_Open etc) executed when
it is running under our VB (VBA) codes?
I've set Excel Tools - Macro - Security - Security Level : High
but there's seems has no effect to the Excel Automation.
I've tried like this:
Sub RunEx()
On Error Resume Next
Dim xl As Excel.Application
Dim wb As Workbook
Set xl = New Excel.Application
'Note untuk password
xl.DisplayAlerts = False
xl.EnableEvents = False
Debug.Print xl.EnableEvents 'return False
Set wb = xl.Workbooks.Open("C:\My Documents\My Data\Excel\Bill
Them.xls")
'This file contains macro in Workbook_Open,
'and the macro is executed!
Debug.Print xl.EnableEvents 'reutrn true --amazing!
xl.quite
set xl = nothing
End sub
Please your help.
best Regards,
-Agus