views:

262

answers:

1

I want to assign a ComboBox control to a class member of ComboBox type. This control is in a group on a worksheet.

The problem is through GroupItems property, I can only get a Shape object, not a ComboBox. So when assigning, it alerts "type dismatch".

If the control was not in a group, I could get an OLEObject object through OLEObjects property, and then use Object property to bypass the type dismatch. But what about now?

A: 

Once you have your Shape object, whether it is in a Group or not, you can access the ComboBox through the DrawingObject.Object property. So it would look something like

Set cboVariable = ActiveSheet.Shapes(1).GroupItems(2).DrawingObject.Object
dmaruca