Need more on dynamically adding buttons at runtime

A

Allan Till

I have created a vb6 COM add in for use with Excel.

I want to add a number of buttons to the menu at runtime depending
on the contents of a folder on the users hard disk.

How can I capture the events from these buttons in the COM add-in given
that I cannot declare instances of the button object withevents at
design time, like this:

Private WithEvents Button1 as Office.ComandBarButton
Private WithEvents Button2 as Office.ComandBarButton

because I only know at runtime how many buttons to add.

I know how to dynamically add buttons but the problem is how to pick up
their events. Can onAction be used to call back to the COM Add-in?
 

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