Code generated ComboBox (ActiveX)

Manually add a combobox to Activesheet and right click to see its properties.
Next, run the following code to add a combobox through code and right click - you won't be able to see the properties now.
Right click on the code-generated control and choose Group->Ungroup as many times to ungroup the control and it is ungrouped into multiple shapes.
Conclusion: The controls added through code are different from the ones manually added.
Sub TestCode() Dim abc As OLEObject Set abc = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _ DisplayAsIcon:=False, Left:=312.75, Top:=99.75, Width:=188.25, Height _ :=24.75) 'If you right click on the combobox thus created you won't be able to view its properties 'as against the one manually added. abc.Object.AddItem "A" 'abc.Object.ListFillRange = "A1:A2" 'This doesn't work Set abc = Nothing End Sub
»
- Vishesh's blog
- Add new comment
- 953 reads

Recent comments
3 hours 25 min ago
10 hours 16 min ago
9 hours 31 min ago
12 hours 35 min ago
22 hours 55 min ago
1 day 2 hours ago
1 day 2 hours ago
1 day 8 hours ago
1 day 9 hours ago
2 days 23 min ago