Microsoft Office Tutorials and References
In Depth Information
Adding a Floating Command Bar
You can add a floating command bar (shown in Figure 17-3) to Excel with the following
routine. Notice that the Add method uses the name Excel2k3 VBA , which has embedded
spaces. The msoBarFloating value specifies that the bar should not be docked with the other
command bars, but instead should be displayed in a separate window that can be moved
around by the user.
Dim c As CommandBar
Set c = Application.CommandBars.Add("Excel2k3 VBA", _
msoBarFloating, False, True)
c.Enabled = True
c.Visible = True
Figure 17-3. A floating command bar is not docked with the other command bars.
Setting the third parameter of the Add method to False means that the command bar will
simply be added to the collection. A value of Tr ue means that this bar will replace the stan
dard menu bar in the Excel application.