Standard Toolbar Association

xl_psychic

Active Member
Joined
Jan 4, 2004
Messages
359
Hi All,

I have created a custom commandbar which houses my own macros..

This command bar is created everytime Excel is opened.

For the time being I have kept the commandbar as a floating object.

Any ideas how can I fix it to be attached next to the Standard CommandBar or the Formatting CommandBar.

Help Appreciated...
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi,

This will add a Custom CommandBar called "Test" ALWAYS located next to the Standard XL toolbar.

Code:
Sub Test()

    Dim i As Byte
    With CommandBars.Add("Test")
         For i = 1 To 6
            .Controls.Add.FaceId = i
        Next i
        .Position = CommandBars("Standard").Position 
        .RowIndex = CommandBars("Standard").RowIndex
        .Visible = True
    End With

End Sub

Regards.
 
Upvote 0
Jaafar:

Thanks for the piece of code... I have only one regret.. What do I need to change in the code for my commandbar to appear "after" the Standard Toolbar...

When I execute this code the custom toolbar appears before the Standard Toolbar... I tried playing with RowIndex and Position values but in vain...

Help Appreciated...
 
Upvote 0
Jaafar:

I did some search on the board for commandbars properties and this piece of code helped me do just what I wanted...

Code:
Set cb = Application.CommandBars.Add(ThisCommandBarName, , False, True)
    
With cb
.Position = CommandBars("Standard").Position
.RowIndex = CommandBars("Standard").RowIndex
.Left = CommandBars("Standard").Left + CommandBars("Standard").Width
.Visible = True
End With

Thanks for the guidance...
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top