PDA

View Full Version : Solved: Floating command bar position



starsky
03-23-2011, 09:24 AM
Hi,

I have a floating command bar that works. For the less experienced user who might receive the workbook I would like to have the command bar float centrally and near the top of the worksheet. Is it possible to set this?

Thanks.

Edit: Sorted.

Bob Phillips
03-24-2011, 02:56 PM
Share the code?

starsky
03-25-2011, 03:14 AM
Sure

Set ComBar = CommandBars.Add(Name:="My Toolbar", Temporary:=True)
With ComBar
.Visible = True
.Position = msoBarFloating
.Left = 975
.Top = 200
End With

So Top and Left are providing the specific position. This is set for the top right corner of a worksheeet on a 17 inch screen, below the header row. If you have 2 screens, it will appear on your primary one.