-
1
- #1
HorseGoose
Programmer
I know that writing command bars can be a pain and very time consuming. Also there are many posts on how to do multilevel menus etc. Please find below the code for a complex multi level command bar whcih you can cut and paste into whatever you want. I have tried to structure it so it is clear.
Sub navibar()
For Each cb In CommandBars
If cb.Name = "Firmenich Marketing Tools - navibar" Then
cb.Delete
Exit For
End If
Next cb
Dim AToolBar As Object
Dim AButton As CommandBarButton
Dim APopup As CommandBarPopup
Dim AsubPopup As CommandBarPopup
Dim AsubPopup1 As CommandBarPopup
Dim AsubPopup2 As CommandBarPopup
Set AToolBar = CommandBars.Add("Firmenich Marketing Tools - navibar", msoBarFloating, False, True)
'----------------------------------------------------------------------------------
' popup menu 1
'----------------------------------------------------------------------------------
Set APopup = AToolBar.Controls.Add(Type:=msoControlPopup)
APopup.Caption = "Program"
'-------button in popup menu 1
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "clean interface"
AButton.OnAction = "initialise"
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "restore interface"
AButton.OnAction = "resetallbars"
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.BeginGroup = True
AButton.Caption = "exit program"
AButton.OnAction = "prog_exit"
'----------------------------------------------------------------------------------
' popup menu 2
'----------------------------------------------------------------------------------
Set APopup = AToolBar.Controls.Add(Type:=msoControlPopup)
APopup.Caption = "Quantitative"
'------- subpopup level 0 in menu 2
Set AsubPopup = APopup.Controls.Add(Type:=msoControlPopup)
AsubPopup.Caption = "overviews"
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firCOL"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Germany"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firCOL"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firLON"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "United Kingdom"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firLON"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firPAR"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "France"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firPAR"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firSPA"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Spain"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firSPA"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firIT"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Italy"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firIT"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firMENA"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Algeria"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Egypt"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Iran"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Morocco"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Saudi Arabia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Tunisia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "UA Emerates"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firMENA"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firVIEN"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Austria"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Czech. rep. & Slovakia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Hungary"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Romania"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firVIEN"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firMOS"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Russia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Ukraine"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firMOS"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firSOUTH"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Ghana"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Kenya"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Ivory Coast"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Nigeria"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "South Africa"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firSOUTH"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firPOL"
'---------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Poland"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firPOL"
AButton.OnAction = ""
'-------------- buttons subpopup level 0
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firTURK"
' AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.BeginGroup = True
AButton.Caption = "EAME"
' AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Western Europe"
' AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Total Zone Europe"
' AButton.OnAction = ""
'------- subpopup level 0 in menu 2
Set AsubPopup = APopup.Controls.Add(Type:=msoControlPopup)
AsubPopup.Caption = "company & brand shares"
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "company shares"
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by zone"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by countries"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "brand shares"
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by zone"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by countries"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'------- subpopup level 0 in menu 2
Set AsubPopup = APopup.Controls.Add(Type:=msoControlPopup)
AsubPopup.Caption = "conversion sheets"
' ----------------- buttons in subpopup level 0 in menu 2
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "FirCOL"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firESPA"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firIT"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firLON"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firMENA"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firMOS"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firPAR"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firPOL"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firSOUTH"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firTURK"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firVIEN"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.BeginGroup = True
AButton.Caption = "total zone Europe"
AButton.OnAction = ""
' ----- buttons in popup menu 2
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "graph generator"
' AButton.OnAction = ""
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "company/brand potential calculator"
' AButton.OnAction = ""
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "icam"
' AButton.OnAction = ""
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "iplan"
' AButton.OnAction = ""
'----------------------------------------------------------------------------------
' popup menu 3
'----------------------------------------------------------------------------------
Set APopup = AToolBar.Controls.Add(Type:=msoControlPopup)
APopup.Caption = "Qualitative"
' ----- buttons in popup menu 3
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "drivers and flavour trends"
' AButton.OnAction = ""
Application.CommandBars("Firmenich Marketing Tools - navibar").Enabled = True
Application.CommandBars("Firmenich Marketing Tools - navibar").Visible = True
Application.CommandBars("Firmenich Marketing Tools - navibar").Protection = msoBarNoCustomize
'Application.CommandBars("Firmenich Marketing Tools - navibar").Protection = msoBarNoChangeDock
End Sub
Sub navibar()
For Each cb In CommandBars
If cb.Name = "Firmenich Marketing Tools - navibar" Then
cb.Delete
Exit For
End If
Next cb
Dim AToolBar As Object
Dim AButton As CommandBarButton
Dim APopup As CommandBarPopup
Dim AsubPopup As CommandBarPopup
Dim AsubPopup1 As CommandBarPopup
Dim AsubPopup2 As CommandBarPopup
Set AToolBar = CommandBars.Add("Firmenich Marketing Tools - navibar", msoBarFloating, False, True)
'----------------------------------------------------------------------------------
' popup menu 1
'----------------------------------------------------------------------------------
Set APopup = AToolBar.Controls.Add(Type:=msoControlPopup)
APopup.Caption = "Program"
'-------button in popup menu 1
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "clean interface"
AButton.OnAction = "initialise"
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "restore interface"
AButton.OnAction = "resetallbars"
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.BeginGroup = True
AButton.Caption = "exit program"
AButton.OnAction = "prog_exit"
'----------------------------------------------------------------------------------
' popup menu 2
'----------------------------------------------------------------------------------
Set APopup = AToolBar.Controls.Add(Type:=msoControlPopup)
APopup.Caption = "Quantitative"
'------- subpopup level 0 in menu 2
Set AsubPopup = APopup.Controls.Add(Type:=msoControlPopup)
AsubPopup.Caption = "overviews"
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firCOL"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Germany"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firCOL"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firLON"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "United Kingdom"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firLON"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firPAR"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "France"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firPAR"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firSPA"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Spain"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firSPA"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firIT"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Italy"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firIT"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firMENA"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Algeria"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Egypt"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Iran"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Morocco"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Saudi Arabia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Tunisia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "UA Emerates"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firMENA"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firVIEN"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Austria"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Czech. rep. & Slovakia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Hungary"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Romania"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firVIEN"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firMOS"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Russia"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Ukraine"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firMOS"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firSOUTH"
' --------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Ghana"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Kenya"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Ivory Coast"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Nigeria"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "South Africa"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firSOUTH"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "firPOL"
'---------------------- buttons subpopup level 1 in menu 2
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Poland"
AButton.OnAction = ""
Set AButton = AsubPopup1.Controls.Add(Type:=msoControlButton)
AButton.Caption = "other firPOL"
AButton.OnAction = ""
'-------------- buttons subpopup level 0
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firTURK"
' AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.BeginGroup = True
AButton.Caption = "EAME"
' AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Western Europe"
' AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "Total Zone Europe"
' AButton.OnAction = ""
'------- subpopup level 0 in menu 2
Set AsubPopup = APopup.Controls.Add(Type:=msoControlPopup)
AsubPopup.Caption = "company & brand shares"
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "company shares"
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by zone"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by countries"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'-------------- subpopup level 1 in menu 2
Set AsubPopup1 = AsubPopup.Controls.Add(Type:=msoControlPopup)
AsubPopup1.Caption = "brand shares"
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by zone"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'---------------------- subpopup level 2 in subpopup level 1 in menu 2
Set AsubPopup2 = AsubPopup1.Controls.Add(Type:=msoControlPopup)
AsubPopup2.Caption = "by countries"
' --------------------- buttons in subpopup level 2 in subpopup level 1 in menu 2
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "soft drinks"
AButton.OnAction = ""
Set AButton = AsubPopup2.Controls.Add(Type:=msoControlButton)
AButton.Caption = "alcoholic drinks"
AButton.OnAction = ""
'------- subpopup level 0 in menu 2
Set AsubPopup = APopup.Controls.Add(Type:=msoControlPopup)
AsubPopup.Caption = "conversion sheets"
' ----------------- buttons in subpopup level 0 in menu 2
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "FirCOL"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firESPA"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firIT"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firLON"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firMENA"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firMOS"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firPAR"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firPOL"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firSOUTH"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firTURK"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "firVIEN"
AButton.OnAction = ""
Set AButton = AsubPopup.Controls.Add(Type:=msoControlButton)
AButton.BeginGroup = True
AButton.Caption = "total zone Europe"
AButton.OnAction = ""
' ----- buttons in popup menu 2
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "graph generator"
' AButton.OnAction = ""
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "company/brand potential calculator"
' AButton.OnAction = ""
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "icam"
' AButton.OnAction = ""
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "iplan"
' AButton.OnAction = ""
'----------------------------------------------------------------------------------
' popup menu 3
'----------------------------------------------------------------------------------
Set APopup = AToolBar.Controls.Add(Type:=msoControlPopup)
APopup.Caption = "Qualitative"
' ----- buttons in popup menu 3
Set AButton = APopup.Controls.Add(Type:=msoControlButton)
AButton.Caption = "drivers and flavour trends"
' AButton.OnAction = ""
Application.CommandBars("Firmenich Marketing Tools - navibar").Enabled = True
Application.CommandBars("Firmenich Marketing Tools - navibar").Visible = True
Application.CommandBars("Firmenich Marketing Tools - navibar").Protection = msoBarNoCustomize
'Application.CommandBars("Firmenich Marketing Tools - navibar").Protection = msoBarNoChangeDock
End Sub