Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Bar position
Howdy
I want my command bar to be positioned what I can only think to call "opposite to being floating". Set MYCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarFloating, Temporary:=True) what is the oppositite to the above? Is it msoBarTop - where does that put it relative to the other menus bars that are at the top? I want to add it above the main window but below all other toolbars. And what and when is the following code used for: MenuBar:=True ? Thanks Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Bar position
Apart from msoBarFloating you can have msoBarLeft msoBarRight msoBarTop msoBarBottom mosBarTop will put the command bar at the top just below the menubar. (The topmost tool bar will be your commandbar). If you set MenuBar:=True then the existing menubar (where you have File, Edit, Instert etc. menus) will disappear and your command bar will take its place if it is msoBarTop. Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Bar position
Thanks Sharad
So how do I put my command bar above my worksheet window below the menubar but below the other command bars there and without replacing any of the command bars that are there? Do I just omit the Position property? Thanks Matt "Sharad" wrote in message ... Apart from msoBarFloating you can have msoBarLeft msoBarRight msoBarTop msoBarBottom mosBarTop will put the command bar at the top just below the menubar. (The topmost tool bar will be your commandbar). If you set MenuBar:=True then the existing menubar (where you have File, Edit, Instert etc. menus) will disappear and your command bar will take its place if it is msoBarTop. Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Bar position
Matt,
You need to provide the "RowIndex"... MyCommandBar.RowIndex = Application.CommandBars("Formatting").RowIndex + 1 If the Formatting toolbar is visible, the above code places MyCommandBar just below the formatting toolbar. No, you cannot determine the rowindex by just counting the visible toolbars. Also, you still need msoBarTop. OR, go thru the CommandBar collection and find the largest rowindex... Sub TestBar() Dim MyCommandBar As CommandBar Dim lngBarIndex As Long For Each MyCommandBar In Application.CommandBars If MyCommandBar.Visible Then lngBarIndex = _ WorksheetFunction.Max(lngBarIndex, MyCommandBar.RowIndex) Next Set MyCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarTop, Temporary:=True) MyCommandBar.RowIndex = lngBarIndex + 1 MyCommandBar.Visible = True Set MyCommandBar = Nothing End Sub Regards, Jim Cone San Francisco, USA "Matt Jensen" wrote in message ... Thanks Sharad So how do I put my command bar above my worksheet window below the menubar but below the other command bars there and without replacing any of the command bars that are there? Do I just omit the Position property? Thanks Matt "Sharad" wrote in message ... Apart from msoBarFloating you can have msoBarLeft msoBarRight msoBarTop msoBarBottom mosBarTop will put the command bar at the top just below the menubar. (The topmost tool bar will be your commandbar). If you set MenuBar:=True then the existing menubar (where you have File, Edit, Instert etc. menus) will disappear and your command bar will take its place if it is msoBarTop. Sharad |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Bar position
Matt,
Looks like there is an easier way, using msoBarRowLast... '-------------------------- Sub TestBarModified() Dim MyCommandBar As CommandBar Set MyCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarTop, Temporary:=True) MyCommandBar.RowIndex = msoBarRowLast MyCommandBar.Visible = True Set MyCommandBar = Nothing End Sub '-------------------------- Regards, Jim Cone "Jim Cone" wrote in message ... Matt, You need to provide the "RowIndex"... MyCommandBar.RowIndex = Application.CommandBars("Formatting").RowIndex + 1 If the Formatting toolbar is visible, the above code places MyCommandBar just below the formatting toolbar. No, you cannot determine the rowindex by just counting the visible toolbars. Also, you still need msoBarTop. OR, go thru the CommandBar collection and find the largest rowindex... Sub TestBar() Dim MyCommandBar As CommandBar Dim lngBarIndex As Long For Each MyCommandBar In Application.CommandBars If MyCommandBar.Visible Then lngBarIndex = _ WorksheetFunction.Max(lngBarIndex, MyCommandBar.RowIndex) Next Set MyCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarTop, Temporary:=True) MyCommandBar.RowIndex = lngBarIndex + 1 MyCommandBar.Visible = True Set MyCommandBar = Nothing End Sub Regards, Jim Cone San Francisco, USA |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Bar position
What do you mean by "Looks Like" Jim?
That's not only the easiest, but the 'Accurately Correct' way! :) Thanks for me too (Apart from Matt will be thankful) cheers! Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Bar position
Great - thanks a lot guys - looks good
Cheers Matt "Jim Cone" wrote in message ... Matt, Looks like there is an easier way, using msoBarRowLast... '-------------------------- Sub TestBarModified() Dim MyCommandBar As CommandBar Set MyCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarTop, Temporary:=True) MyCommandBar.RowIndex = msoBarRowLast MyCommandBar.Visible = True Set MyCommandBar = Nothing End Sub '-------------------------- Regards, Jim Cone "Jim Cone" wrote in message ... Matt, You need to provide the "RowIndex"... MyCommandBar.RowIndex = Application.CommandBars("Formatting").RowIndex + 1 If the Formatting toolbar is visible, the above code places MyCommandBar just below the formatting toolbar. No, you cannot determine the rowindex by just counting the visible toolbars. Also, you still need msoBarTop. OR, go thru the CommandBar collection and find the largest rowindex... Sub TestBar() Dim MyCommandBar As CommandBar Dim lngBarIndex As Long For Each MyCommandBar In Application.CommandBars If MyCommandBar.Visible Then lngBarIndex = _ WorksheetFunction.Max(lngBarIndex, MyCommandBar.RowIndex) Next Set MyCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarTop, Temporary:=True) MyCommandBar.RowIndex = lngBarIndex + 1 MyCommandBar.Visible = True Set MyCommandBar = Nothing End Sub Regards, Jim Cone San Francisco, USA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
One command in one cell initiating another command in another cel. | Excel Worksheet Functions | |||
command code ( GOTO command) in formula | New Users to Excel | |||
command button position | Excel Discussion (Misc queries) | |||
Pivot Table Error Message - "Command Text not set for command obje | Excel Discussion (Misc queries) | |||
Command Button Position | Excel Discussion (Misc queries) |