Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Initial position of floating toolbar

Excel XP & Win XP
I got some code from VBAExpress.com to create a floating toolbar on file
opening and it works well.
My problem is that the sheet that is on the screen is a busy sheet and the
initial position of the toolbar can easily bury the toolbar in the sheet
clutter. I would like to specify the initial position of the toolbar, then
the user can move it as he wishes.
How can I specify the initial position of the tool bar? The toolbar is
Commandbars("My Toolbar").
Thanks for your time. Otto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Initial position of floating toolbar

Try something like the following. The command bar will be on the same row as
the Standard command bar. Commented code shows how to place it on the first
or last row of command bars.

Sub AAA()
Dim CmdBar As Office.CommandBar
Dim Ctrl As Office.CommandBarButton

On Error Resume Next
Application.CommandBars("Test").Delete
On Error GoTo 0
Set CmdBar = Application.CommandBars.Add(Name:="Test", Position:=msoBarTop)
'CmdBar.RowIndex = msoBarRowFirst ' or msoBarRowLast
CmdBar.RowIndex = Application.CommandBars("Standard").RowIndex
CmdBar.Visible = True
Set Ctrl = CmdBar.Controls.Add(Type:=msoControlButton)
Ctrl.Caption = "Click Me"
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Otto Moehrbach" wrote in message
...
Excel XP & Win XP
I got some code from VBAExpress.com to create a floating toolbar on file
opening and it works well.
My problem is that the sheet that is on the screen is a busy sheet and the
initial position of the toolbar can easily bury the toolbar in the sheet
clutter. I would like to specify the initial position of the toolbar,
then the user can move it as he wishes.
How can I specify the initial position of the tool bar? The toolbar is
Commandbars("My Toolbar").
Thanks for your time. Otto



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating toolbar and floating comment? StargateFan[_3_] Excel Programming 2 December 5th 05 10:26 PM
floating toolbar Gixxer_J_97[_2_] Excel Programming 2 September 23rd 05 01:09 PM
Get floating CommandBar position Patti[_2_] Excel Programming 4 July 18th 05 09:08 PM
Floating Toolbar Dave Excel Discussion (Misc queries) 4 April 29th 05 04:57 PM
floating toolbar scottwilsonx[_67_] Excel Programming 2 October 29th 04 01:24 PM


All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"