context menu

  • Thread starter Thread starter eric23
  • Start date Start date
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
 
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)
 
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)
 
It's a pleasure.

--

HTH

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top