Application.EnableEvents

  • Thread starter Thread starter DCPan
  • Start date Start date
Go into the VBE
Hit ctrl-g (to see the immediate window)
type:
application.enableevents = true
and hit enter.
 
I keep these two handy on a Toolbar for when I'm working on event code and
screwing it up.

Sub enable_events()
Application.EnableEvents = True
End Sub

Sub disable_events()
Application.EnableEvents = False
End Sub


Gord Dibben MS Excel MVP
 
Hi,

In your finished code you should consider something like this

Sub myProcedure()
On Error GoTo ErrorHandler

'your code here

ErrorHandler:
Application.EnableEvents = True
End Sub
 
Back
Top