Application.EnableEvents

D

DCPan

If you accidentally disabled events due to an error in logic, how do you turn
it back on?
 
D

Dave Peterson

Go into the VBE
Hit ctrl-g (to see the immediate window)
type:
application.enableevents = true
and hit enter.
 
G

Gord Dibben

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
 
S

ShaneDevenshire

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top