Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link toolbar button to macro in excel at run time

Status
Not open for further replies.

kelqc

Programmer
Feb 16, 2003
31
0
0
AU
Hi
I am using Excel 97, I have written code to add a tool bar and add a button, at run time, these open up just fine at startup. But I don't know how to link the button to run a "sub" function in my code at run time.

I can do it manually by right clicking on the button, selecting custimise, right click on button again, select assign macro, then choose macro from the list.

But I want all of the above paragragh to be done in the code.

Can anybody give me some ideas.

Thanks

Kelvin
 
Sorry all, I have found the answer to my question in a previous posting, thanks anyway.

Kelvin
 
kelqc, thanks for sharing.
Can you please tell the members how you solved your problem ?
(I guess you've played with the OnAction property of your CommandBarControl object, didn't you ?)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi PHV

Yep, you are right.

I found a posting from qjd2004 sent on 03/08/04, asking the same question.

The reply given by Loomah was excellent. Loomah has answered my question and more, thanks Loomah.

I encourage all to take a look at this posting.

Thanks

Kelvin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top