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
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
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