Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating a combobox Scott J[_2_] Excel Programming 2 June 7th 07 10:07 PM
Populating Combobox WLMPilot Excel Programming 17 March 28th 07 03:07 AM
Populating a combobox WLMPilot Excel Programming 1 March 12th 07 08:07 PM
ComboBox populating problem Werner[_33_] Excel Programming 1 July 29th 05 10:00 PM
Populating a ComboBox DirInfo Excel Programming 1 March 17th 05 10:03 PM


All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"