Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi NG
Is there someway to add items to the right mouse menu in Excel? And perhaps even do it dynamically, so that one get some sort of context sensitive menu? Regards Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mark
try the following procedures (they add/delete an entry to the cell context menu): Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "My message is here - put code at this place" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Mark wrote: Hi NG Is there someway to add items to the right mouse menu in Excel? And perhaps even do it dynamically, so that one get some sort of context sensitive menu? Regards Mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Suggested slight amendment to Frank's code, just as an insurance
Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub I would also suggest that you look at John Walkenbach's faceid to see what built-in faceids youy could select from http://j-walk.com/ss/excel/tips/tip67.htm -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Frank Kabel" wrote in message ... Hi Mark try the following procedures (they add/delete an entry to the cell context menu): Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "My message is here - put code at this place" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Mark wrote: Hi NG Is there someway to add items to the right mouse menu in Excel? And perhaps even do it dynamically, so that one get some sort of context sensitive menu? Regards Mark |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob
good point! -- Regards Frank Kabel Frankfurt, Germany "Bob Phillips" schrieb im Newsbeitrag ... Suggested slight amendment to Frank's code, just as an insurance Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub I would also suggest that you look at John Walkenbach's faceid to see what built-in faceids youy could select from http://j-walk.com/ss/excel/tips/tip67.htm -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Frank Kabel" wrote in message ... Hi Mark try the following procedures (they add/delete an entry to the cell context menu): Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "My message is here - put code at this place" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Mark wrote: Hi NG Is there someway to add items to the right mouse menu in Excel? And perhaps even do it dynamically, so that one get some sort of context sensitive menu? Regards Mark |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Error handling is always nice :-)
Thanks for the link to the faceid application. This will definitetly come in handy! :-) /Mark "Bob Phillips" wrote in message ... Suggested slight amendment to Frank's code, just as an insurance Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) On Error Resume Next New_Entry.Controls("My message").Delete On Error Goto 0 With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub I would also suggest that you look at John Walkenbach's faceid to see what built-in faceids youy could select from http://j-walk.com/ss/excel/tips/tip67.htm -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Frank Kabel" wrote in message ... Hi Mark try the following procedures (they add/delete an entry to the cell context menu): Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "My message is here - put code at this place" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Mark wrote: Hi NG Is there someway to add items to the right mouse menu in Excel? And perhaps even do it dynamically, so that one get some sort of context sensitive menu? Regards Mark |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks alot! works like a charm. :-)
"Frank Kabel" wrote in message ... Hi Mark try the following procedures (they add/delete an entry to the cell context menu): Sub Add_Item() Dim New_Entry As Object Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True) With New_Entry .Caption = "My message" .OnAction = "Message" End With End Sub Sub Message() MsgBox "My message is here - put code at this place" End Sub Sub Delete_Item() Dim myControl As CommandBarButton For Each myControl In CommandBars("Cell").Controls If myControl.Caption = "My message" Then myControl.Delete End If Next End Sub -- Regards Frank Kabel Frankfurt, Germany Mark wrote: Hi NG Is there someway to add items to the right mouse menu in Excel? And perhaps even do it dynamically, so that one get some sort of context sensitive menu? Regards Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add find and replace to context menu | Excel Discussion (Misc queries) | |||
context menu formatting toolbar | New Users to Excel | |||
Add items to context menu | Excel Worksheet Functions | |||
Implementing Context Sensitive Help in Excel App using VBA. | Excel Discussion (Misc queries) | |||
context sensitive help | Excel Programming |