Custom Command Bar

T

Tom Ulincy

First question - I have a custom command bar that I want
users to use. Some of the functions on the custom command
bar are similar to those on built-in command bars (e.g. a
Close button vs File/Close on the menu bar). I'd prefer
not to hide any visible built-in command bars. Is there a
way to dis-able the functionality of visible command bars
without hiding them?

Second question - For what / how do you use the Tag
property of a command bar button?

TIA
Tom
 
R

Ron de Bruin

Hi

Sub test()
Dim myCmd As Object
On Error Resume Next
Set myCmd = CommandBars("Worksheet menu bar")
For a = 1 To myCmd.Controls.Count
myCmd.Controls(a).Enabled = True
Next
End Sub

Try this one

With tag you give a menuitem you add a unique name
This way it is easy to delete it

Set MyDropDownItem = Application.CommandBars.FindControl(Tag:="MyDropDownItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If

See the VBA help
 

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