Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to add a separator line to isolate the new option I added to the end
of a context menu. I have not been able to find the necessary code. My code to add the item is taken from a Microsoft example, but I'm not sure it's as efficient as it could be: Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) Dim icbc As Object For Each icbc In Application.CommandBars("cell").Controls If icbc.Tag = "brccm" Then icbc.Delete Next icbc If Not Application.Intersect(Target, Range("RiskItems")) Is Nothing Then With Application.CommandBars("cell").Controls _ .Add(Type:=msoControlButton, temporary:=True) .Caption = "Access Risk List" .OnAction = "ShowList" .Tag = "brccm" End With End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean) Dim icbc As Object For Each icbc In Application.CommandBars("cell").Controls If icbc.Tag = "brccm" Then icbc.Delete Next icbc If Not Application.Intersect(Target, Range("RiskItems")) Is Nothing Then With Application.CommandBars("cell").Controls _ .Add(Type:=msoControlButton, temporary:=True) .BeginGroup = True .Caption = "Access Risk List" .OnAction = "ShowList" .Tag = "brccm" End With End If End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Goody" wrote in message ... I want to add a separator line to isolate the new option I added to the end of a context menu. I have not been able to find the necessary code. My code to add the item is taken from a Microsoft example, but I'm not sure it's as efficient as it could be: Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) Dim icbc As Object For Each icbc In Application.CommandBars("cell").Controls If icbc.Tag = "brccm" Then icbc.Delete Next icbc If Not Application.Intersect(Target, Range("RiskItems")) Is Nothing Then With Application.CommandBars("cell").Controls _ .Add(Type:=msoControlButton, temporary:=True) .Caption = "Access Risk List" .OnAction = "ShowList" .Tag = "brccm" End With End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding commands to the Excel 2007 Chart context menu | Charts and Charting in Excel | |||
Context Menu (Sub-Menu Disable/Enable) | Excel Programming | |||
Disable Sub-Menu of a Context Menu | Excel Programming | |||
Context Menu | Excel Programming | |||
Adding Separator Menu Item - Excel 2003 | Excel Programming |