Assigning a button to a subroutine

H

Harry-Wishes

Hello.

I created a custom toolbar which contains a single button. No sweat.

Now, is there a programmatic way to write a subroutine that can attach this
button to another subroutine. Maybe "assign to a suubroutine" is better
terminology. I have done an exhaustive hunt on the topic but I come up short.
Below, is a snippet of code where I created an object to the toolbar and the
button. This is as far as I've been able to go.

Dim ctlToggle As Office.CommandBarButton
Set ctlToggle = CommandBars("Letter_Toolbar").Controls(1)

Help appreciated as always.

Harry-Wishes
 
D

Dave Peterson

Saved from a previous post:

Your life will become much simpler if you include code to create the toolbar
when the workbook is opened and include code to destroy the toolbar when the
workbook is closed.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

In xl2007, those toolbars and menu modifications will show up under the addins.
 

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