Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a real simple routine that use to add a new command to the RightClick
Menu. Sub CreateRightClick() With Application.CommandBars("Cell").Controls.Add .Caption = "Remove" .OnAction = "Remove" End With End Sub But for some reason, now it does not work. Nothing is add to the RightClick menu. What I want is "Remove" added to the menu and when clicked, for it to run the macro "Remove". Two, can I add other commands with "Sub CreateRightClick2()". I have only added one command before. Any Help is Always Appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't know why it didn't work. maybe there was an error in the runcode.
Have you tried stepping through it? Does Remove already exist on the menu. You can add m ultiples like so Sub CreateRightClick() With Application.CommandBars("Cell") With .Controls.Add .Caption = "Remove" .OnAction = "Remove" End With With .Controls.Add .Caption = "Remove2" .OnAction = "Remove2" End With End With End Sub -- HTH ------- Bob Phillips "Ronbo" wrote in message ... I have a real simple routine that use to add a new command to the RightClick Menu. Sub CreateRightClick() With Application.CommandBars("Cell").Controls.Add .Caption = "Remove" .OnAction = "Remove" End With End Sub But for some reason, now it does not work. Nothing is add to the RightClick menu. What I want is "Remove" added to the menu and when clicked, for it to run the macro "Remove". Two, can I add other commands with "Sub CreateRightClick2()". I have only added one command before. Any Help is Always Appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Bob Phillips" wrote: I don't know why it didn't work. maybe there was an error in the runcode. Have you tried stepping through it? Does Remove already exist on the menu. You can add m ultiples like so Sub CreateRightClick() With Application.CommandBars("Cell") With .Controls.Add .Caption = "Remove" .OnAction = "Remove" End With With .Controls.Add .Caption = "Remove2" .OnAction = "Remove2" End With End With End Sub -- HTH ------- Bob Phillips "Ronbo" wrote in message ... I have a real simple routine that use to add a new command to the RightClick Menu. Sub CreateRightClick() With Application.CommandBars("Cell").Controls.Add .Caption = "Remove" .OnAction = "Remove" End With End Sub But for some reason, now it does not work. Nothing is add to the RightClick menu. What I want is "Remove" added to the menu and when clicked, for it to run the macro "Remove". Two, can I add other commands with "Sub CreateRightClick2()". I have only added one command before. Any Help is Always Appreciated. Thanks Bob. You are right it was a simple error in the code that I check over and over and did not find until after the post. However, I like and use your multiple commands. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Ronbo" wrote: I have a real simple routine that use to add a new command to the RightClick Menu. Sub CreateRightClick() With Application.CommandBars("Cell").Controls.Add .Caption = "Remove" .OnAction = "Remove" End With End Sub But for some reason, now it does not work. Nothing is add to the RightClick menu. What I want is "Remove" added to the menu and when clicked, for it to run the macro "Remove". Two, can I add other commands with "Sub CreateRightClick2()". I have only added one command before. Any Help is Always Appreciated. Never mind. I got it and it works fine. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macros and Menu Command | Excel Discussion (Misc queries) | |||
How disable menu command | Excel Discussion (Misc queries) | |||
Name command in Insert Menu | Excel Discussion (Misc queries) | |||
Add Command to Right-Click Menu | Excel Programming | |||
Command Bar Menu - Management | Excel Programming |