XL2k: ActiveX Controls on sheets.

  • Thread starter Thread starter Mike Mertes
  • Start date Start date
M

Mike Mertes

I can't seem manipulate ActiveX controls on sheets from public VB code.

This code works:
Debug.Print ThisWorkbook.Worksheets("Sheet1").OLEObjects("ComboBox1").Name

It returns the name of an ActiveX combo box... But, I can't use, for
instance, .AddItem instead of .Name.

Maybe the problem is that the properties and methods for MSXL's ActiveX
controls on sheets are different from the properties and methods used to
manipulate the same controls on forms? If that is the case, I can't find a
list of properties and methods :(

If someone could point me in the right direction, I would appreciate it!

Thanks everyone.
-Mike
 
ThisWorkbook.Worksheets("Sheet1").OLEObjects("ComboBox1").Object.AddItem
"item1"

the OLEObject is the container. The object is the combobox. A property
like the listfillrange belongs to the container, however.
 
Aha! Problem solved.

Thanks Tom! The world owes you a hand for disolving ignorance! Share your
knowledge, spread it well... ;)
 

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

Back
Top