Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Floating toolbar and floating comment? | Excel Programming | |||
excel should have a floating "custom view" toolbar | Excel Worksheet Functions | |||
Dock a custom toolbar | Excel Programming | |||
Dock a custom toolbar | Excel Programming | |||
remove toolbar without excel opened | Excel Programming |