Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Toolbar is floating every time when excel is opened, how to dock?

Hi there,
Macro generates the toolbar and this is done by calling
"create_toolbar" from a module. The call "create_toolbar" is in
"Workbook_Open" event...as a result the toolbar is recreated/
repositioned as floating.... I tried protection/position properties
but ..nothing really helped....

Recreating of toolbar is ok but not the repositioning... Is there a
way to remember the last docking position and save that in the addins
file... so that the x and y or something similar can be pulled from
the xla. OR just to find out the best fit docking position....

your support is triple appreciated. Thanks!

musa.biralo

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Toolbar is floating every time when excel is opened, how to dock?

If the toolbar already exists, then don't delete and re-create. Just insure
that it is visible.

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"musa.biralo" wrote in message
ups.com...
Hi there,
Macro generates the toolbar and this is done by calling
"create_toolbar" from a module. The call "create_toolbar" is in
"Workbook_Open" event...as a result the toolbar is recreated/
repositioned as floating.... I tried protection/position properties
but ..nothing really helped....

Recreating of toolbar is ok but not the repositioning... Is there a
way to remember the last docking position and save that in the addins
file... so that the x and y or something similar can be pulled from
the xla. OR just to find out the best fit docking position....

your support is triple appreciated. Thanks!

musa.biralo



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Toolbar is floating every time when excel is opened, how to dock?

You can save your toolbar's position in the registry and restore it from
there like this:

Sub SaveToolbarPos()
With CommandBars("ABC")
SaveSetting "MyUtils", "MyToolbar", "Pos", .Position
SaveSetting "MyUtils", "MyToolbar", "Top", .Top
SaveSetting "MyUtils", "MyToolbar", "Left", .Left
End With
End Sub

Sub SetToolbarPos()
With CommandBars("ABC")
.Position = GetSetting("MyUtils", "MyToolbar", "Pos", msoBarFloating)
.Top = GetSetting("MyUtils", "MyToolbar", "Top", 1)
.Left = GetSetting("MyUtils", "MyToolbar", "Left", 1)
End With
End Sub


--
Jim
"musa.biralo" wrote in message
ups.com...
| Hi there,
| Macro generates the toolbar and this is done by calling
| "create_toolbar" from a module. The call "create_toolbar" is in
| "Workbook_Open" event...as a result the toolbar is recreated/
| repositioned as floating.... I tried protection/position properties
| but ..nothing really helped....
|
| Recreating of toolbar is ok but not the repositioning... Is there a
| way to remember the last docking position and save that in the addins
| file... so that the x and y or something similar can be pulled from
| the xla. OR just to find out the best fit docking position....
|
| your support is triple appreciated. Thanks!
|
| musa.biralo
|


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Toolbar is floating every time when excel is opened, how to dock?

Change the macro so the commandbar is not floating

MyCmdBar.Position = msoBarFloating '(or 4)

but is docked somewhere

MyCmdBar.Position = msoBarTop '(or 1)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"musa.biralo" wrote in message
ups.com...
Hi there,
Macro generates the toolbar and this is done by calling
"create_toolbar" from a module. The call "create_toolbar" is in
"Workbook_Open" event...as a result the toolbar is recreated/
repositioned as floating.... I tried protection/position properties
but ..nothing really helped....

Recreating of toolbar is ok but not the repositioning... Is there a
way to remember the last docking position and save that in the addins
file... so that the x and y or something similar can be pulled from
the xla. OR just to find out the best fit docking position....

your support is triple appreciated. Thanks!

musa.biralo



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Toolbar is floating every time when excel is opened, how to dock?

Hey There Jim,
thanks a lot...
It was perfect solution and perfect match!

I just add one more line then everything worked liked charm!!!!
Thanks again....

Sub SaveToolbarPos()
With CommandBars("ABC")
SaveSetting "MyUtils", "MyToolbar", "Pos", .Position
SaveSetting "MyUtils", "MyToolbar", "Top", .Top
SaveSetting "MyUtils", "MyToolbar", "Left", .Left
SaveSetting "MyUtils", "MyToolbar", "RowIndex", .RowIndex
End With
'DeleteSetting "MyUtils", "MyToolbar"
End Sub

Sub SetToolbarPos()
With CommandBars("IDModeling")
.Position = GetSetting("MyUtils", "MyToolbar", "Pos",
msoBarFloating)
.Top = GetSetting("MyUtils", "MyToolbar", "Top", 1)
.Left = GetSetting("MyUtils", "MyToolbar", "Left", 1)
.RowIndex = GetSetting("MyUtils", "MyToolbar", "RowIndex", 1)
End With
End Sub


On Oct 9, 1:49 pm, "Jim Rech" wrote:
You can save your toolbar's position in the registry and restore it from
there like this:

Sub SaveToolbarPos()
With CommandBars("ABC")
SaveSetting "MyUtils", "MyToolbar", "Pos", .Position
SaveSetting "MyUtils", "MyToolbar", "Top", .Top
SaveSetting "MyUtils", "MyToolbar", "Left", .Left
End With
End Sub

Sub SetToolbarPos()
With CommandBars("ABC")
.Position = GetSetting("MyUtils", "MyToolbar", "Pos", msoBarFloating)
.Top = GetSetting("MyUtils", "MyToolbar", "Top", 1)
.Left = GetSetting("MyUtils", "MyToolbar", "Left", 1)
End With
End Sub

--
Jim"musa.biralo" wrote in message

ups.com...
| Hi there,
| Macro generates the toolbar and this is done by calling
| "create_toolbar" from a module. The call "create_toolbar" is in
| "Workbook_Open" event...as a result the toolbar is recreated/
| repositioned as floating.... I tried protection/position properties
| but ..nothing really helped....
|
| Recreating of toolbar is ok but not the repositioning... Is there a
| way to remember the last docking position and save that in the addins
| file... so that the x and y or something similar can be pulled from
| the xla. OR just to find out the best fit docking position....
|
| your support is triple appreciated. Thanks!
|
| musa.biralo
|





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Toolbar is floating every time when excel is opened, how to dock?

Hi Bob!

Thanks for the suggestion!..Howevery, that did not work....

Thanks though.

musa.biralo


On Oct 8, 6:30 pm, "Bob Flanagan" wrote:
If the toolbar already exists, then don't delete and re-create. Just insure
that it is visible.

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"musa.biralo" wrote in message

ups.com...

Hi there,
Macro generates the toolbar and this is done by calling
"create_toolbar" from a module. The call "create_toolbar" is in
"Workbook_Open" event...as a result the toolbar is recreated/
repositioned as floating.... I tried protection/position properties
but ..nothing really helped....


Recreating of toolbar is ok but not the repositioning... Is there a
way to remember the last docking position and save that in the addins
file... so that the x and y or something similar can be pulled from
the xla. OR just to find out the best fit docking position....


your support is triple appreciated. Thanks!


musa.biralo



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Toolbar is floating every time when excel is opened, how to dock?

Thanks Jon!

Below was the perfect and i think more advanced solution so i adopt
that...
Thanks for the input.

musa.biralo

On Oct 9, 8:38 pm, "Jon Peltier"
wrote:
Change the macro so the commandbar is not floating

MyCmdBar.Position = msoBarFloating '(or 4)

but is docked somewhere

MyCmdBar.Position = msoBarTop '(or 1)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

"musa.biralo" wrote in message

ups.com...

Hi there,
Macro generates the toolbar and this is done by calling
"create_toolbar" from a module. The call "create_toolbar" is in
"Workbook_Open" event...as a result the toolbar is recreated/
repositioned as floating.... I tried protection/position properties
but ..nothing really helped....


Recreating of toolbar is ok but not the repositioning... Is there a
way to remember the last docking position and save that in the addins
file... so that the x and y or something similar can be pulled from
the xla. OR just to find out the best fit docking position....


your support is triple appreciated. Thanks!


musa.biralo



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
excel should have a floating "custom view" toolbar pablo Excel Worksheet Functions 2 July 4th 05 08:31 PM
Dock a custom toolbar Spencer Hutton Excel Programming 1 March 12th 05 02:45 PM
Dock a custom toolbar Spencer Hutton[_4_] Excel Programming 0 March 12th 05 01:52 PM
remove toolbar without excel opened hans.werner Excel Programming 4 February 19th 04 09:01 AM


All times are GMT +1. The time now is 06:43 PM.

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"