don't allow excel event kill

X

x taol

application.enableevents=false
the code can kill the event routine of all workbooks.

The anyone can kill xl event with that code of one line.
I want to live continually the event in the specific workbook only.
how to method?
excel guru !!,,, answer...help me..


*** Sent via Developersdex http://www.developersdex.com ***
 
R

Rick Rothstein \(MVP - VB\)

If you suspect that your events have become turned off, you can always go
into the VBA editor and execute this line...

Application.EnableEvents = True

in the Immediate window to restore the event processing. If you are using
this in your code, you should structure things like this...

Sub DoIt(...) ' or Function DoIt(...)
On Error GoTo MakeEverythingRight
Application.EnableEvents = False
'......
'...... <<Your code goes here>>
'......
Exit Sub ' or Exit Function <<== optional, depends on code
MakeEverythingRight:
Application.EnableEvents = True
End Sub ' or End Function

Rick
 
J

JLGWhiz

Rick, the way I interpreted the OP was that they want to know how to prevent
someone else from disabling events by using the code line. I was going to
recommend securing the code module with password protection, but that is the
extreme.
 

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