Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Disable Command Bar Edit Control

I am attempting to use this sub routine to disable the cut control under the
Edit menu and all the sub menus, but the menu is still allowing me to cut. I
have Excel 2003. Any help is appreciated.

Sub MenuControl_False()
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Disable Command Bar Edit Control

You're probably refering to Ctrl X
This is how you do that:
'Divert Ctrl + X = Cut
Application.OnKey "^x", "NoNo"

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"iperlovsky" wrote:

I am attempting to use this sub routine to disable the cut control under the
Edit menu and all the sub menus, but the menu is still allowing me to cut. I
have Excel 2003. Any help is appreciated.

Sub MenuControl_False()
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Disable Command Bar Edit Control

Read also this:
http://www.mrexcel.com/archive/VBA/1981.html
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"iperlovsky" wrote:

I am attempting to use this sub routine to disable the cut control under the
Edit menu and all the sub menus, but the menu is still allowing me to cut. I
have Excel 2003. Any help is appreciated.

Sub MenuControl_False()
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Disable Command Bar Edit Control

And if you don't want to write the nono sub, do this:
Application.OnKey "^x", ""
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Michael" wrote:

You're probably refering to Ctrl X
This is how you do that:
'Divert Ctrl + X = Cut
Application.OnKey "^x", "NoNo"

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"iperlovsky" wrote:

I am attempting to use this sub routine to disable the cut control under the
Edit menu and all the sub menus, but the menu is still allowing me to cut. I
have Excel 2003. Any help is appreciated.

Sub MenuControl_False()
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Disable Command Bar Edit Control

I am trying to disable the "cut" control from all menus in sheet 1.

"Michael" wrote:

You're probably refering to Ctrl X
This is how you do that:
'Divert Ctrl + X = Cut
Application.OnKey "^x", "NoNo"

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"iperlovsky" wrote:

I am attempting to use this sub routine to disable the cut control under the
Edit menu and all the sub menus, but the menu is still allowing me to cut. I
have Excel 2003. Any help is appreciated.

Sub MenuControl_False()
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Disable Command Bar Edit Control

I do not know why but none of these "grey out" (ie, disable) the cut command
from all menus in the sheet.

"Michael" wrote:

Read also this:
http://www.mrexcel.com/archive/VBA/1981.html
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"iperlovsky" wrote:

I am attempting to use this sub routine to disable the cut control under the
Edit menu and all the sub menus, but the menu is still allowing me to cut. I
have Excel 2003. Any help is appreciated.

Sub MenuControl_False()
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
End Sub

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Disable Command Bar Edit Control

Hi,

All the techniques are described here

http://www.rondebruin.nl/menuid.htm

Mike

"iperlovsky" wrote:

I am attempting to use this sub routine to disable the cut control under the
Edit menu and all the sub menus, but the menu is still allowing me to cut. I
have Excel 2003. Any help is appreciated.

Sub MenuControl_False()
Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
Ctrl.Enabled = False
Next Ctrl
End Sub

Reply
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
copy command is disable under edit menu Anirban Dutta Excel Discussion (Misc queries) 2 March 22nd 07 10:56 AM
Disable the Delete Control in the Edit Menu Virtual Hillbilly Excel Programming 1 July 23rd 06 10:50 AM
Disable Edit Fill TEAM[_8_] Excel Programming 5 December 16th 05 09:42 PM
Disable Edit Query Peter Sze[_2_] Excel Programming 3 September 22nd 04 09:18 AM
Disable the Edit menu command 'Paste Special' George Raymond Excel Programming 4 December 22nd 03 04:44 AM


All times are GMT +1. The time now is 07:23 PM.

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

About Us

"It's about Microsoft Excel"