escape key


Posted by mike on December 04, 2001 10:58 AM

I'm disabling the right click in a workbook and I would also like to disable the escape key. Can I do that?

Posted by Rick E on December 04, 2001 1:15 PM

Use the OnKey command, the following will 'disable' the escape key on the keyboard.

Application.OnKey "{ESC}", "No_Change"

and this command

Application.OnKey "{ESC}"

will turn it back on.

Good Luck, Rick E



Posted by Rick E on December 04, 2001 1:34 PM

Use OnKey Command

Here are example macros to turn on and off the escape key on the keyboard.

Sub NoChange()
i = 0 ' does nothing, used by NoEsc macro
End Sub


Sub NoEsc()
Application.OnKey "{ESC}", "NoChange"
' Goes to procedure NoChange if escape key hit
End Sub


Sub YesEsc()
Application.OnKey "{ESC}"
' Turns on the keyboard escape key.
End Sub


Good Luck, Rick E.