Disable short cut keys

dcoledc

Active Member
Joined
May 6, 2010
Messages
403
I want to disable shortcut keys on workbook open but I don't want to upset anyone. How can I test for shortcut key assignment, so I can save and restore when the workbook closes? With other application settings I just tested with a msgbox. With the shortcut keys that doesn't work.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Do you want to turn off ALL shortcut keys, or are there particular ones that you don't want turned off?
 
Upvote 0
Give these a go:

Code:
Public Sub DisableShortcuts()
With Application
   .OnKey "^c", ""
   .OnKey "^v", ""
   .OnKey "^w", ""
   .OnKey "^x", ""
End With
End Sub

Public Sub EnableShortcuts()
With Application
   .OnKey "^c"
   .OnKey "^v"
   .OnKey "^w"
   .OnKey "^x"
End With
End Sub
 
Upvote 0
I have actually already done that. My concern, based on surfing the web, is that some people may have reassigned their short cut keys and if I disable, I may mess things up for them. Is that not the case?
 
Upvote 0
As far as I'm aware, this is the only way to disable keyboard shortcuts.
 
Upvote 0
When I turn off toolbars. etc, I first test to see if the user already has them on or not. This way when I close the workbook, I can set them back to there original settings. I am trying to do the same thing with the shortcut keys. Meaning, if the user has assigned Ctrl "^C" to do something other than copy and then I go and set to defualt that is going to upset some folks.

Having said that, is there a way to test for shorcut key assignment?

Forgive me, if you already understood this is what I was asking. I coulnd't tell from your response.
 
Upvote 0

Forum statistics

Threads
1,214,654
Messages
6,120,758
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top