Object: Scripting Object
Detaches an object's event sources from script functions with a given prefix.
Scripting.DetachEvents (ByVal Object As Object, ByVal ObjectName As String) As Boolean
The object from which you want to detach.
Prefix string used to map the object events for this instance. When the object fires an event named Foo, the script engine calls a subroutine named EventPrefix_Foo.
Boolean indicating whether the method succeeded (True) or failed (False).
' Detach application object from its event handlers with prefix appEvents
Dim app
Set app = GetObject(, "MGCPCB.Application")
Call Scripting.DetachEvents(app, "appEvents")