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
- Login or register to post comments
- 7022 reads
Recent comments
5 years 42 weeks ago
6 years 28 weeks ago
6 years 40 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 49 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago