Add Button to End of Menu Bar

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

I am adding some button to the end of a menu bar and trying to create a group
at the same time

I am using the following function to try and begin the group bit it wants to
begin the group 1 button early


Set myMenuBar = application.CommandBars("essOption")
Set lastMenu = myMenuBar.Controls(myMenuBar.Controls.Count)
lastMenu.BeginGroup = True
 
I am adding some button to the end of a menu bar and trying to create a group
at the same time

I am using the following function to try and begin the group bit it wants to
begin the group 1 button early


Set myMenuBar = application.CommandBars("essOption")
Set lastMenu = myMenuBar.Controls(myMenuBar.Controls.Count)
lastMenu.BeginGroup = True

Nigel: Add your new button first, then set the new button's BeginGroup
property to True.

Set lastMenu =
myMenuBar.Controls.Add(msoControlButton,,,myMenuBar.Controls.Count + 1)
lastMenu.BeginGroup = True
 

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