LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Disabling Commands

Hi
I'm trying to disable a few commands (like Copy etc).

I'm using the following to address all command bar controls as necessary

Sub Find_Disable_Commands()
Dim myControls As CommandBarControls
Dim ctl As CommandBarControl
Set myControls = CommandBars.FindControls _
(Type:=msoControlButton, ID:=21) 'cut
For Each ctl In myControls
ctl.Enabled = 0
Next ctl
End Sub

The next part is disabling keyboard shortcuts. I'm aware of one way to do
this which is to create a 'blank' macro and assign the keyboard shortcut to
it, eg assign Ctrl+X to
Sub Kut()
'nothing here!
End Sub

The question is, is this the best way to do this (I 've done it manually)
and if so how do I reset the normal shortcut command when leaving the
workbook ie make Ctrl+X into cut again when closing the book or switching
between books??

Many thanks in advance



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling saving Mr. Burton Excel Worksheet Functions 4 October 21st 08 12:14 PM
Disabling Cut and Copy Varne Excel Discussion (Misc queries) 13 August 21st 08 03:12 PM
Disabling formula Mel D Excel Discussion (Misc queries) 2 May 25th 08 10:54 PM
disabling shorcuts Ron de Bruin Excel Programming 0 August 3rd 03 12:03 PM
Auto_Open disabling Tritan Excel Programming 6 July 22nd 03 11:48 AM


All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"