Forum Discussion
mesg2anil
14 years agoRegular Contributor
Hi Robert,
I added and event for "OnLogError" as you said, below is the script for the same... but it is erroring out saying "Invalid number of "OnLogError" event handler parameters." Please suggest!!
GeneralEvents_OnLogError
I added and event for "OnLogError" as you said, below is the script for the same... but it is erroring out saying "Invalid number of "OnLogError" event handler parameters." Please suggest!!
Sub GeneralEvents_OnLogError'(Sender, LogParams)
'Close all browser or excel file or any process which you want to terminte all together in one go
GeneralEvents_OnLogError
IExplore = Sys.FindAllChildren("ProcessName","EXCEL")
If UBound(IExplore)>=0 Then
For i = UBound(IExplore) to LBound(IExplore) Step -1 ' <== iterate from top to bottom
Set Excel = Sys.OleObject("Excel.Application")
Call Excel.ActiveWorkbook.Save
Call Excel.Workbooks.Close
IExplore(i).Terminate
Next
End If
End Sub