Two menus appears in commandbar(Cells)

H

helmekki

Hi there
i have a problem,
when openning the XL App, two menus should be added to th
Commandbar(Cells) :
one is:

Code
-------------------
Set ComPop = Application.CommandBars("Cell").Controls.Add(Type:=msoControlPopup, before:=10)
ComPop.BeginGroup = True
ComPop.Caption = "&Favourites
-------------------

Second is:

Code
-------------------
With Application.CommandBars("cell").Controls.Add(before:=1, Type:=msoControlPopup)
.Caption = "Gold Menu"
End Wit
-------------------


The problme is that one appears in the comaandbar(cells) but hte othe
not, i tried to modify the argument before:=1 or 2 or even 9, bu
without success, both togather never appear in the commandbar(cells).
i need them both to be appear in the commandbar(Cells)
 
B

Bob Phillips

They both create for me. Is there anything else?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
O

okaizawa

Hi,

are you in the page break preview mode?
there are two(and more) commandbars named "Cell". one is a shortcut
menu in the normal view, another is in the page break preview.
if you want to customize all "Cell" commandbars, try this:

Sub Test()
Dim cb As CommandBar
For Each cb In Application.CommandBars
If cb.Name = "Cell" And cb.BuiltIn Then
'your code to add items.
With .Controls.Add(Type:=msoControlPopup, before:=10)
.BeginGroup = True
.Caption = "&Favourites"
End With
End If
Next
End Sub
 

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