Hello,
Am writing code to temporarily create a custom command bar on load of an excel worksheet.
Command bar is then populated with a command button relating to each of the workbooks sheet tabs.
-----------
Set cbar = Application.CommandBars.Add(Name:="WorkSheet Navigator", Position:=msoBarFloating)
cbar.Visible = True
For Each wsheet In Workbooks("command bars.xls").Worksheets
Set cbCtl = cbar.Controls.Add(Type:=msoControlButton)
cbCtl.Visible = True
cbCtl.Style = msoButtonIconAndCaption
cbCtl.FaceId = 2105
cbCtl.Caption = wsheet.Name
cbCtl.OnAction = "Worksheet" & wsheet.Name
Next
-------------
My problem is, each button is added to the right hand side of the command bar, which just becomes a long strip.
I want to limit the length of the command bar and have the various buttons layer down in two or three lines on the command bar.
I have tried limiting the command bar width, to no avail.
Can someone point me in the direction to set the command bar to multi line??
Am writing code to temporarily create a custom command bar on load of an excel worksheet.
Command bar is then populated with a command button relating to each of the workbooks sheet tabs.
-----------
Set cbar = Application.CommandBars.Add(Name:="WorkSheet Navigator", Position:=msoBarFloating)
cbar.Visible = True
For Each wsheet In Workbooks("command bars.xls").Worksheets
Set cbCtl = cbar.Controls.Add(Type:=msoControlButton)
cbCtl.Visible = True
cbCtl.Style = msoButtonIconAndCaption
cbCtl.FaceId = 2105
cbCtl.Caption = wsheet.Name
cbCtl.OnAction = "Worksheet" & wsheet.Name
Next
-------------
My problem is, each button is added to the right hand side of the command bar, which just becomes a long strip.
I want to limit the length of the command bar and have the various buttons layer down in two or three lines on the command bar.
I have tried limiting the command bar width, to no avail.
Can someone point me in the direction to set the command bar to multi line??