PC Review


Reply
Thread Tools Rate Thread

disable shortcut keys

 
 
=?Utf-8?B?Q2hyaXMgV2lsa2luc29u?=
Guest
Posts: n/a
 
      7th Jun 2007
Hi,

I need to disble all Excel's shortcuts such as ctrl+c, etc. I there an
easier way than looping through all the combinations of alt, ctrl, shift and
each key combination and disabling them with application.onkey?

thanks
Chris
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      7th Jun 2007
Saved from a old post

You can use Onkey (see VBA Help)

Try this two macro's

Sub UIT()
Dim K, Key, Key2, i As Integer
On Error Resume Next


For Each Key In Array("+", "^", "%", "+^", "+%", "^%", "+^%")


K = Array("{BS}", "{BREAK}", "{CAPSLOCK}", "{CLEAR}", "{DEL}", _
"{DOWN}", "{END}", "{ENTER}", "~", "{ESC}", "{HELP}", "{HOME}", _
"{INSERT}", "{LEFT}", "{NUMLOCK}", "{PGDN}", "{PGUP}", _
"{RETURN}", "{RIGHT}", "{SCROLLLOCK}", "{TAB}", "{UP}")


For Each Key2 In K
Application.OnKey Key & Key2, ""
Next Key2


For i = 0 To 255
Application.OnKey Key & Chr$(i), ""
Next i


For i = 1 To 15
Application.OnKey Key & "{F" & i & "}", ""
Application.OnKey "{F" & i & "}", ""
Next i
Next
Application.OnKey "{PGDN}", ""
Application.OnKey "{PGUP}", ""
End Sub


Sub AAN()
Dim K, Key, Key2, i As Integer
On Error Resume Next


For Each Key In Array("+", "^", "%", "+^", "+%", "^%", "+^%")


K = Array("{BS}", "{BREAK}", "{CAPSLOCK}", "{CLEAR}", "{DEL}", _
"{DOWN}", "{END}", "{ENTER}", "~", "{ESC}", "{HELP}", "{HOME}", _
"{INSERT}", "{LEFT}", "{NUMLOCK}", "{PGDN}", "{PGUP}", _
"{RETURN}", "{RIGHT}", "{SCROLLLOCK}", "{TAB}", "{UP}")


For Each Key2 In K
Application.OnKey Key & Key2
Next Key2


For i = 0 To 255
Application.OnKey Key & Chr$(i)
Next i


For i = 1 To 15
Application.OnKey Key & "{F" & i & "}"
Application.OnKey "{F" & i & "}"
Next i
Next
Application.OnKey "{PGDN}"
Application.OnKey "{PGUP}"
End Sub




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Chris Wilkinson" <(E-Mail Removed)> wrote in message
news:C71FD91B-C0CF-4FD4-8840-(E-Mail Removed)...
> Hi,
>
> I need to disble all Excel's shortcuts such as ctrl+c, etc. I there an
> easier way than looping through all the combinations of alt, ctrl, shift and
> each key combination and disabling them with application.onkey?
>
> thanks
> Chris


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable CUT via toolbars or shortcut keys sparx Microsoft Excel Misc 0 30th Apr 2006 08:34 PM
Disable shortcut keys =?Utf-8?B?Sg==?= Windows XP General 1 29th Mar 2006 05:59 PM
Disable Shortcut Keys Ronbo Microsoft Excel Programming 1 25th May 2004 03:12 PM
IE shortcut keys..disable jessica Windows XP Internet Explorer 1 25th Mar 2004 07:20 PM
Disable local shortcut keys Robert Margadonna Windows XP Customization 0 15th Sep 2003 03:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:19 PM.