context menu

E

eric23

hi!
can anyone get me started on how to add/remove items from right click menu
(via vb.net or vba? )

thanks - eric
 
B

Bob Phillips

Eric,

An example disabling Insert Comment

With Application.CommandBars("Cell")
.Controls("Insert Comment").Enabled = False
End With

and this adds a command

With Application.CommandBars("Cell")
With .Controls.Add(Type:=msoControlButton, temporary:=True)
.BeginGroup = True
.Caption = "Insert Date"
.OnAction = "myDateMacro"
End With
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
E

eric23

wow
thanks Bob!

Bob Phillips said:
Eric,

An example disabling Insert Comment

With Application.CommandBars("Cell")
.Controls("Insert Comment").Enabled = False
End With

and this adds a command

With Application.CommandBars("Cell")
With .Controls.Add(Type:=msoControlButton, temporary:=True)
.BeginGroup = True
.Caption = "Insert Date"
.OnAction = "myDateMacro"
End With
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

It's a pleasure.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top