I need help with a VBA code that I’m working on. I’m trying to create a ListBox control in a worksheet with the following code:
Sub CreateListBoxControl()
Dim objLB As OLEObject ‘ OLE Object
Dim WS As Worksheet
Set WS = ActiveSheet
Set objLB = WS.OLEObjects.Add(Classtype:=”Forms.ListBox.1″, _
Left:=Cells(1, 3).Left, Top:=Cells(1, 3).Top + 12, _
Width:=180, Height:=41.25).OLEObject
With objLB
.ListFillRange = Range(“B1:B3”)
End With
End Sub
The error message that I get says that “object doesn’t support this property”.