I have this code below which creates a CommandBar but my problem is that I thought the line of Code .Width 100 would make the width of the actual CommandBar increase if I adjusted that number, but this doesnt seem to be the case. The title in only shows Nursing Sta instead of Nursing Staff Rota.
How can I make the CommandBar wider than is?
Sub ShowMenu()
Dim cmdBar As CommandBar
Dim cmdPopup As CommandBarPopup
Dim cmdButton As CommandBarButton
DeleteMenu
Set cmdBar = CommandBars.Add(Name:="Nursing Staff Rota", _
Position:=msoBarFloating, Temporary:=True)
With cmdBar
.Top = 250
.Left = 900
Set cmdPopup = .Controls.Add(Type:=msoControlPopup)
With cmdPopup
.Caption = "Create New Rota"
.BeginGroup = True
Set cmdButton = .Controls.Add(Type:=msoControlButton)
With cmdButton
.Caption = "Create New Rota"
.Style = msoButtonCaption
.BeginGroup = True
.OnAction = "ChangeRotaWeek"
End With
Set cmdButton = .Controls.Add(Type:=msoControlButton)
With cmdButton
.Caption = "Add New Nursing Staff"
.Style = msoButtonCaption
.BeginGroup = True
.OnAction = "CopyRow"
End With
Set cmdButton = .Controls.Add(Type:=msoControlButton)
With cmdButton
.Caption = "Exit Nursing Staff Rota"
.Style = msoButtonCaption
.BeginGroup = True
.OnAction = "ExitRota"
End With
End With
.Width = 100
.Visible = True
End With
End Sub
Bookmarks