ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add to Combo Control from referenced worksheet object (https://www.excelbanter.com/excel-programming/409010-add-combo-control-referenced-worksheet-object.html)

Matt[_41_]

Add to Combo Control from referenced worksheet object
 
I have a workbook that contains a worksheet named "Sheet1"
on that worksheet I have a combo box (type: control toolbar) . I have
a little procedure that adds values to the combo box. When
I refer to the combo box as
thisworkbook.worksheets("Sheet1").combobox1.AddIte m i
or for that matter wkb.worksheets("Sheet1").comboBox1.Additem i
it works fine. However when I create a reference to a worksheet object
in thisworkbook
Such as:
set wkb = thisworkbook
set wks = wkb.worksheets("Sheet1")
wks.ComboBox1.AddItem i
and add an item, I get an error message. Does anyone know why that is?
Thanks,
Matt


All times are GMT +1. The time now is 07:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com