ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Preventing users from breaking code with ESC (https://www.excelbanter.com/excel-programming/388203-preventing-users-breaking-code-esc.html)

joost[_2_]

Preventing users from breaking code with ESC
 
Hello,

I would like to prevent users from interrupting my routines globally.
assigning "{ESC}" to a macro helped slightly, but still i sometimes see
the "code execution has been interrupted" popup when i press escape.
I know about EnableCancelKey, is there something like that which would
work globally?

Thank you very much for any help/pointers you can provide.
Joost
--
Friends help you move, real friends help you move bodies.

Norman Jones

Preventing users from breaking code with ESC
 
Hi Joost,

See VBA help for details of the EnableCancelKey Property.


---
Regards,
Norman




"joost" wrote in message
l...
Hello,

I would like to prevent users from interrupting my routines globally.
assigning "{ESC}" to a macro helped slightly, but still i sometimes see
the "code execution has been interrupted" popup when i press escape.
I know about EnableCancelKey, is there something like that which would
work globally?

Thank you very much for any help/pointers you can provide.
Joost
--
Friends help you move, real friends help you move bodies.




Jim Cone

Preventing users from breaking code with ESC
 

A better solution might be to speed up your code so that users don't
become impatient. If they cannot use Escape then they would have
to resort to Task Manager and close Excel - that won't help your
reputation.
You could also add a message box (when escape is pressed) asking for
confirmation that they want to exit. That would eliminate concern that
the program is not responding.
In addition, adding a progress bar or some information in the Status Bar
lets the user know that the code is working.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"joost" wrote in message l...
Hello,

I would like to prevent users from interrupting my routines globally.
assigning "{ESC}" to a macro helped slightly, but still i sometimes see
the "code execution has been interrupted" popup when i press escape.
I know about EnableCancelKey, is there something like that which would
work globally?

Thank you very much for any help/pointers you can provide.
Joost
--
Friends help you move, real friends help you move bodies.


All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com