Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to disable CTRL key

8 views
Skip to first unread message

Bon

unread,
Dec 13, 2005, 4:55:22 AM12/13/05
to
Dear all

I am wondering how to disable the Ctrl key. Thus, user can't use
CTRL+P, CTRL+O,.. etc to trigger build in functions?

Thanks
Bon

Peter Rooney

unread,
Dec 13, 2005, 5:11:02 AM12/13/05
to
Hi, Bon,

You don't disable the Ctrl key as such, rather the things that you'd want to
do with it. here's some code i run when one of my workbooks is opened.

'Application.OnKey "^{n}", "" 'disable creation of new workbook
'Application.OnKey "%{F11}", "" 'disable [Shift]+F11 to view code
'Application.OnKey "%{F8}", "" 'disable [Shift]+F8 to run macros

the ^ character represents [Control] - hence ^{n} is the same a Control+N
The % represents [Alt]
You use + to repesent [Shift]

When you close the workbook, you can run

Application.OnKey "^{n}"
Application.OnKey "%{F11}"
Application.OnKey "%{F8}"

to reset the key combinations to their original dunctions.

Check out the Help on ONKEY

Hope this helps

Regards

Pete

0 new messages