Excel 2007 Menus


G

Guest

I am creating a menu with code that works in 03 to create a menu, and when I
call the routine, in Excel 07, the menu goes into the Add-Ins tab of the
ribbon. If I Hide the ribbon with a different routine, the code does not
make this section visible. Here is a section of the code:


Code:
Dim myBar As CommandBar
'Dim SubItem As CommandBarButton
Dim myItem As CommandBarControl

On Error Resume Next 'In case it has already gone.
Application.CommandBars("Navigation_Bar").Delete
On Error GoTo 0

Set myBar = Application.CommandBars.Add(MenuBar:=True)
With myBar
.Name = "Navigation_Bar"
.Visible = True
'.Position=msoBarFloating
'Temporary:=True)
End With
'Add Menu Item
Set myItem = myBar.Controls.Add(Type:=msoControlPopup)
With myItem
.Caption = "Actions"
.BeginGroup = True
'    .FaceId = 334
End With

'First Sub Item
Set mySubItem = myItem.Controls.Add(Type:=msoControlButton)
With mySubItem
.Caption = "Load Components"
.OnAction = "Load_Components"
End With
Set mySubItem = myItem.Controls.Add(Type:=msoControlButton)
With mySubItem
.Caption = "Delete Navigation Bar"
.OnAction = "Delete_Navigation_Bar"
End With


What I would like is a clean menubar with only items in it that I created
like it works in 03. I would be open to another option, but hopefully not
the full Ribbon... It takes up too much room...
 
Ad

Advertisements

B

Bob Phillips

Not possible. The ribbon is not as configurable as the old commandbars. You
either have it all or nothing.

You can create your own group using XML, but it will still be part of a full
ribbon.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Ad

Advertisements

J

Jim Rech

but it will still be part of a full ribbon.

startFromScratch?



--
Jim
| Not possible. The ribbon is not as configurable as the old commandbars.
You
| either have it all or nothing.
|
| You can create your own group using XML, but it will still be part of a
full
| ribbon.
|
| --
| HTH
|
| Bob
|
| (there's no email, no snail mail, but somewhere should be gmail in my
addy)
|
| | >I am creating a menu with code that works in 03 to create a menu, and
when
| >I
| > call the routine, in Excel 07, the menu goes into the Add-Ins tab of the
| > ribbon. If I Hide the ribbon with a different routine, the code does
not
| > make this section visible. Here is a section of the code:
| >
| >
| >
Code:
Dim myBar As CommandBar
| > 'Dim SubItem As CommandBarButton
| > Dim myItem As CommandBarControl
| >
| > On Error Resume Next 'In case it has already gone.
| >    Application.CommandBars("Navigation_Bar").Delete
| > On Error GoTo 0
| >
| > Set myBar = Application.CommandBars.Add(MenuBar:=True)
| >    With myBar
| >    .Name = "Navigation_Bar"
| >    .Visible = True
| >    '.Position=msoBarFloating
| >    'Temporary:=True)
| >    End With
| > 'Add Menu Item
| > Set myItem = myBar.Controls.Add(Type:=msoControlPopup)
| > With myItem
| >    .Caption = "Actions"
| >    .BeginGroup = True
| > '    .FaceId = 334
| > End With
| >
| >    'First Sub Item
| >    Set mySubItem = myItem.Controls.Add(Type:=msoControlButton)
| >    With mySubItem
| >        .Caption = "Load Components"
| >        .OnAction = "Load_Components"
| >    End With
| >    Set mySubItem = myItem.Controls.Add(Type:=msoControlButton)
| >    With mySubItem
| >        .Caption = "Delete Navigation Bar"
| >        .OnAction = "Delete_Navigation_Bar"
| >    End With
| >
| >
| > What I would like is a clean menubar with only items in it that I
created
| > like it works in 03. I would be open to another option, but hopefully
not
| > the full Ribbon... It takes up too much room...
|
|
 

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