remove a control from a worksheet

G

Guest

This is the code I used to remove the control, I get runtime error 5 'invalid
procedure call or argument'. Here is the code I used to remove the control:
application.CommandBars("Worksheet Menu Bar").Controls("cmd").Delete

This is the code I used to Add the control:
Set cmd = Application.CommandBars("Worksheet Menu Bar").Controls.Add
With cmd
.BeginGroup = True
.Caption = "myControl"
.BeginGroup = True
.OnAction = "Insert Macro Name Here"
End With
 
G

Guest

Give this a try...

application.CommandBars("Worksheet Menu Bar").Controls("myControl").Delete
 

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

Top