preventing Application.EnableEvents = False

X

x taol

i want to avoid the preventing excel event to stop.
my workbook have a lot of event procedures.
but, anyone can do stop my event codes using the below code.
Application.EnableEvents = False
He will make the excel application which upper code, and then when the
code run, my workbook events all will stop.
i want to prevent that.

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

AA2e72E

In order to execute the expression that disables events is from the visual
basic editor (alt + F11) in the immediate window or using a sub.

You might have to disable Alt + F11 as soon as your workbook is opened
(Auto+Open).

This wil still permit users access to Tools | Macro | Visual Basic Editor.
In order to disable this you would need something like:

Application.CommandBars.ActiveMenuBar.Controls("Tools").enabled = False

BUT: the latter will affect ALL Excel sessions and yourself ... you won't be
able to get to your code. Not nice!

Perhaps you could use an Application.onTime handler to reset events to true
.... but then users can disable this as well.

Interesting question!
 

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