Comboxbox in Commandbar

G

Guest

Hi all,
I have an addin and have one commandbar in it. Im facing a problem in
inserting value when ever i open a excel file i want to fill the combox box
with sheet names.
im not able to do it by VBA; any help, link or sample code will be of good
help...
 
G

Guest

i have the Auto_Open for my addin where im creating the combobox; now the
problem is i want to poplate the control's value by calling a procedure... do
u have some help on this point?

thanx
bhavtosh

Tom Ogilvy said:
Why not. There is an additem method for the control.
 
T

Tom Ogilvy

You don't need to call a procedure. Once you create the control, you can
populate it with additem

for each sh in ActiveWorkbook.Worksheets
cbCombo.AddItem sh.name
Next

where cbCombo represents a reference to your control.

This assumes the workbook you want to work with is open.

--
Regards,
Tom Ogilvy


Bhavtosh said:
i have the Auto_Open for my addin where im creating the combobox; now the
problem is i want to poplate the control's value by calling a procedure... do
u have some help on this point?

thanx
bhavtosh
 
G

Guest

thanx a ton!

Tom Ogilvy said:
You don't need to call a procedure. Once you create the control, you can
populate it with additem

for each sh in ActiveWorkbook.Worksheets
cbCombo.AddItem sh.name
Next

where cbCombo represents a reference to your control.

This assumes the workbook you want to work with is open.
 

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