ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Control & Break (https://www.excelbanter.com/excel-programming/305134-control-break.html)

Alan.Hutchins

Control & Break
 
I have a problem with 1 or 2 "super" users.

Occasionally they will press the Ctrl+Break keys because
they can't be bothered to make a couple of simple
selections (which only takes3 to 4 seconds anyway).

As a result, the information they supply can be incorrect
because they may have entered data against a cost centre
that is not valid for their entity (I can't validate their
data as it has to be free form entry).

Is there a way that I can stop Control & Break from
stopping the execution of my code during the Auto_open
procedure ?

Also, I want to make sure that it is re-enabled when the
Auto_open procedure has completed.

Many Thanks
Alan

Tom Ogilvy

Control & Break
 
Look at Excel VBA help on EnableCancelKey

I know that works with escape and I assume it works with ctrl+break although
I haven't tested it.

--
Regards,
Tom Ogilvy

"Alan.Hutchins" wrote in message
...
I have a problem with 1 or 2 "super" users.

Occasionally they will press the Ctrl+Break keys because
they can't be bothered to make a couple of simple
selections (which only takes3 to 4 seconds anyway).

As a result, the information they supply can be incorrect
because they may have entered data against a cost centre
that is not valid for their entity (I can't validate their
data as it has to be free form entry).

Is there a way that I can stop Control & Break from
stopping the execution of my code during the Auto_open
procedure ?

Also, I want to make sure that it is re-enabled when the
Auto_open procedure has completed.

Many Thanks
Alan




No Name

Control & Break
 
I am not absolutly sure but I think Control+Break is hard
coded in stone. It's the programers panic button.
-----Original Message-----
I have a problem with 1 or 2 "super" users.

Occasionally they will press the Ctrl+Break keys because
they can't be bothered to make a couple of simple
selections (which only takes3 to 4 seconds anyway).

As a result, the information they supply can be incorrect
because they may have entered data against a cost centre
that is not valid for their entity (I can't validate

their
data as it has to be free form entry).

Is there a way that I can stop Control & Break from
stopping the execution of my code during the Auto_open
procedure ?

Also, I want to make sure that it is re-enabled when the
Auto_open procedure has completed.

Many Thanks
Alan
.


Alan Hutchins

Control & Break <Reply
 
Tom,

Many thanks - you are correct.

However, if I disable it, I could end up with a continuous
loop - which is not a good idea, so instead, I can use the
functionality to ask for a password (so that I can break
out of the code) which the user won't know.....
-----Original Message-----
Look at Excel VBA help on EnableCancelKey

I know that works with escape and I assume it works with

ctrl+break although
I haven't tested it.

--
Regards,
Tom Ogilvy

"Alan.Hutchins"

wrote in message
...
I have a problem with 1 or 2 "super" users.

Occasionally they will press the Ctrl+Break keys because
they can't be bothered to make a couple of simple
selections (which only takes3 to 4 seconds anyway).

As a result, the information they supply can be

incorrect
because they may have entered data against a cost centre
that is not valid for their entity (I can't validate

their
data as it has to be free form entry).

Is there a way that I can stop Control & Break from
stopping the execution of my code during the Auto_open
procedure ?

Also, I want to make sure that it is re-enabled when the
Auto_open procedure has completed.

Many Thanks
Alan



.



All times are GMT +1. The time now is 09:06 PM.

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