Create Toolbar with VBA

A

AMK4

How dos one go about creating a new toolbar with VBA? Everything
found online talks about creating custom menus, but that's not what
want. I want a toolbar that I can then have floating, or docked at th
top or bottom of the screen. Pointers anyone
 
T

Tushar Mehta

Toolbars and menus use the same underlying architecture: commandbars.

Even the main menu you see is a commandbar. In XL, the base menu is a
commandbar named "Worksheet Menu bar".

It's only a question of whether you start with a new commandbar or add a
commandbarpopup or a commandbarbutton in an existing commandbar.

See XL VBA help for the 'Add Method' In there select the dropdown 'Add
method as it applies to the CommandBarControls object.' and also see the
corresponding example. The example actually describes how to create a new
commandbar.

You can also visit John Walkenbach's site, particularly http://www.j-
walk.com/ss/excel/tips/commandbars.htm

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
A

AMK4

Thanks Tushar. That gave a good start. Now, 2 questions:

- when one goes to the Add-Ins... menu and they get a list of all
available add-ins, when you select one there's a little description box
at the bottom of that window. Where do I set the text that goes in
there?

- How do I force the name that shows up to start lowercase instead of
upper? The xla file I've created is called 'xlCookies Toolbar', yet in
the Add-Ins menu it shows up as 'Xlcookies Toolbar' It always seems to
want to run the equivalent of .Proper on the name.
 
B

Bob Phillips

AMK4 said:
Thanks Tushar. That gave a good start. Now, 2 questions:

- when one goes to the Add-Ins... menu and they get a list of all
available add-ins, when you select one there's a little description box
at the bottom of that window. Where do I set the text that goes in
there?

Make the add-in not an addin, set the IsAddin property of the ThisWorkbook
object to False in the VBIDE, and then in Excel, menu File>Properties, and
set the comments. Then make an addin again.
- How do I force the name that shows up to start lowercase instead of
upper? The xla file I've created is called 'xlCookies Toolbar', yet in
the Add-Ins menu it shows up as 'Xlcookies Toolbar' It always seems to
want to run the equivalent of .Proper on the name.

How are you creating it/naming it. I have add-ins that start with a
lower-case letter.
 
A

AMK4

Bob said:
Make the add-in not an addin, set the IsAddin property of the
ThisWorkbook
object to False in the VBIDE, and then in Excel, menu File>Properties,
and
set the comments. Then make an addin again.

Aha! That worked. And, it also fixed the other problem with the
lower/uppercase naming. Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top