Vizsla
01-02-2012, 02:12 PM
Welcome Everyone,
I would like to replace the default excel menus with my homebrew own menus.
Here is the code for creating new menu:
Sub newmenu()
Dim cmdBar As CommandBar
Set cmdBar = Application.CommandBars("Worksheet Menu Bar")
Dim cmdBarControl As CommandBarControl
Set cmdBarControl = cmdBar.Controls.Add(Type:=msoControlPopup, temporary:=True)
With cmdBarControl
.Caption = "Cow"
With .Controls.Add(Type:=msoControlButton)
.Caption = "Add new Cow"
.OnAction = "form_start"
End With
End With
End Sub
And now I want to hide or remove the default menubar, but I haven't solved it yet.
I 've found a solution for enable menus, but it coundn't remove the menu, but it would be disabled status.
CommandBars("Tools").Enabled = False
But I would like to remove completely the default menu.
How can I reach this?
Any help would be greatly appreciated!
Very thanks.
I would like to replace the default excel menus with my homebrew own menus.
Here is the code for creating new menu:
Sub newmenu()
Dim cmdBar As CommandBar
Set cmdBar = Application.CommandBars("Worksheet Menu Bar")
Dim cmdBarControl As CommandBarControl
Set cmdBarControl = cmdBar.Controls.Add(Type:=msoControlPopup, temporary:=True)
With cmdBarControl
.Caption = "Cow"
With .Controls.Add(Type:=msoControlButton)
.Caption = "Add new Cow"
.OnAction = "form_start"
End With
End With
End Sub
And now I want to hide or remove the default menubar, but I haven't solved it yet.
I 've found a solution for enable menus, but it coundn't remove the menu, but it would be disabled status.
CommandBars("Tools").Enabled = False
But I would like to remove completely the default menu.
How can I reach this?
Any help would be greatly appreciated!
Very thanks.