Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking Custom Toolbars?

Status
Not open for further replies.

avatarp

Technical User
Jul 3, 2002
22
CA
In Excel I have created code that, when run, places the custom toolbars in the positions the belong. However if I pull the toolbars of the toolbar field so that it is floating the code still works but the toolbars hover over the place the belong. How do I get them to redock into the toolbar field?

Pertenant code:

For Each Toolbar In Application.Toolbars
iii = iii + 1
MyToolbarName = Toolbar.Name

If MyToolbarName = "" Then
GoTo 5
End If
Xvar = Workbooks("ToolbarTest.xls").Sheets("ToolbarControls").Cells(1 + iii, 3)
Yvar = Workbooks("ToolbarTest.xls").Sheets("ToolbarControls").Cells(1 + iii, 4)
Zvar = Workbooks("ToolbarTest.xls").Sheets("ToolbarControls").Cells(1 + iii, 5)
CommandBars(MyToolbarName).RowIndex = Xvar
CommandBars(MyToolbarName).Left = Yvar
CommandBars(MyToolbarName).Top = Zvar

5 Next


Notes: ToolbarControls is the worksheet with the x,y, and z coordinates of the toolbars
 
When a toolbar is floating, there is a title bar associated with it. Just double-click the title bar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top