Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Positioning of custom toolbars

0 views
Skip to first unread message

Henrik Ryberg

unread,
May 18, 2001, 7:31:29 AM5/18/01
to
I have a little Excel toolbar, which is created every time my add-in runs.
(positioned in the "Library" folder for autoregistration in the regedit - into
the "Tools" - "Addins" list)

But..... It's very annoying that it has to be repositioned manually every time
Excel has been closed.

In the VBA environment, it's possible to read the length of the visible toolbars,
but you can only set the ".position" property to either "Top" - "Bottom" - "Left"
- "Right" or "Floating". (not with X and Y co-ordinates)

I've noticed from other applications that it is actually possible to position a
custom toolbar at the end of eg. the "Standard" toolbar - but haven't so far been
able to figure out how ???


My questions are:

Is it possible to read the settings of the .xlb file ?

Can the .xlb file be opened with an editor somehow ?

How do you manipulate these settings ?
- are they accesible through the registry ?


Best regards,
Henrik Ryberg

Bernie Deitrick

unread,
May 18, 2001, 8:24:45 AM5/18/01
to
Henrik,

When you add the toolbar, set its position. To have it follow a specific toolbar,
set its left and rowindex properties:

Set myBar = Application.CommandBars.Add("NewCommands")

With myBar
'Set buttons first
.Position = msoBarTop
.Left = CommandBars("Standard").Width
.RowIndex = CommandBars("Standard").RowIndex
.Visible = True
.Enabled = True
End With

HTH,
Bernie

Jim Rech

unread,
May 18, 2001, 8:33:17 AM5/18/01
to
>>I have a little Excel toolbar, which is created every time my add-in runs.

If it's "created" every time your add-in runs then it has no "memory" of
where the last instance was. In the case of my personal toolbars that are
created new each time Personal.xls is opened, I save their positions in the
registry (when Personal closes) and have the creation process position them
to their last positions according to what is found in the registry.

Re the XLB. There is no editor and no documentation of the file's format.

--
Jim Rech
Excel MVP

0 new messages