Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem Populating a ComboBox
When using the following code I get the error "Object doesn't support this
property or Method" Public Sub Create_Supplier_List() ' Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", Link:=False, _ DisplayAsIcon:=False, Left:=48.75, Top:=53.25, Width:=159, Height:= _ 18.75) Sheets(2).cb.ListFillRange = Sheets(2).Range("C2:C6") End Sub Please can you assist me with my problem. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem Populating a ComboBox
OLEObjects combobox does not have a ListFillRange property. You will have to
populate the coombobox using the AddItem method. Or you can use the control from the Control Toolbox which does have a ListFillRangeProperty. "Gary Kie" wrote: When using the following code I get the error "Object doesn't support this property or Method" Public Sub Create_Supplier_List() ' Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", Link:=False, _ DisplayAsIcon:=False, Left:=48.75, Top:=53.25, Width:=159, Height:= _ 18.75) Sheets(2).cb.ListFillRange = Sheets(2).Range("C2:C6") End Sub Please can you assist me with my problem. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem Populating a ComboBox
On the other hand, this worked for me...
(assumes "Sheet2" is the name of the sheet containing the data) '-- Public Sub Create_Supplier_List_R1() Dim cb As OLEObject Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", _ Link:=False, DisplayAsIcon:=False, Left:=48.75, Top:=53.25, _ Width:=159, Height:=18.75) cb.ListFillRange = "Sheet2!C2:C6" End Sub -- Jim Cone Portland, Oregon USA "Gary Kie" wrote in message When using the following code I get the error "Object doesn't support this property or Method" Public Sub Create_Supplier_List() Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", Link:=False, _ DisplayAsIcon:=False, Left:=48.75, Top:=53.25, Width:=159, Height:=18.75) Sheets(2).cb.ListFillRange = Sheets(2).Range("C2:C6") End Sub Please can you assist me with my problem. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem Populating a ComboBox
I stand corrected. I always create my forms manually, so I have more to
learn in doing them by code. "Jim Cone" wrote: On the other hand, this worked for me... (assumes "Sheet2" is the name of the sheet containing the data) '-- Public Sub Create_Supplier_List_R1() Dim cb As OLEObject Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", _ Link:=False, DisplayAsIcon:=False, Left:=48.75, Top:=53.25, _ Width:=159, Height:=18.75) cb.ListFillRange = "Sheet2!C2:C6" End Sub -- Jim Cone Portland, Oregon USA "Gary Kie" wrote in message When using the following code I get the error "Object doesn't support this property or Method" Public Sub Create_Supplier_List() Set cb = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Combo Box.1", Link:=False, _ DisplayAsIcon:=False, Left:=48.75, Top:=53.25, Width:=159, Height:=18.75) Sheets(2).cb.ListFillRange = Sheets(2).Range("C2:C6") End Sub Please can you assist me with my problem. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populating a combobox | Excel Programming | |||
Populating Combobox | Excel Programming | |||
Populating a combobox | Excel Programming | |||
ComboBox populating problem | Excel Programming | |||
Populating a ComboBox | Excel Programming |