Disabling INTERRUPT when code is running

LEXCERM

Registered User.
Local time
Tomorrow, 07:09
Joined
Apr 12, 2004
Messages
169
Hi there,

I require some suggestions regarding disabling the ESC key (or any intterupt method) whilst code is running. I have a routine whereby I am importing Outlook details, amongst other things, and the code may take approx 30 seconds to complete. I want to make sure that a user does not interrupt this whilst it's running.

I've tried to use Excel automation and the Application.EnableCAncelKey event but it doesn't seem to work.

Do you have any suggestions?

Thanks in advance,
Paul.
 
If you are using Access you can disable Special keys by going to Tools>Startup then uncheck the Use Access Special Keys checkbox. This solution only works if they don't hold the shift button down while opening the database, that too can be disabled though, search the forum or Google for AllowBypassKey.

If you are looking for a more Global solution you could look at using APIs to disable keybord input then re-enable it after your update is complete, however I would caution against doing that because if you have an unhandled error and your keyboard is disabled it's time for a reboot.
 
LEXCERM,

Do you mean to disable the "Shift" key on startup. If you do, give me your email address, I send you a module which will do that.

If not, basicly anyone can just press "Ctrl + Alt + Del" to force your application to stop. And there is no cure for that.

PS. May be some WinAPI can disable root key.
 

Users who are viewing this thread

Back
Top Bottom