B,
Note the object.object...
'-------------------------------
Sub ARoundForTheHouse()
Dim obj As OLEObject
For Each obj In ActiveSheet.OLEObjects
If TypeName(obj.Object) = "CheckBox" Then
MsgBox obj.Name & " " & obj.Object.Value
ElseIf TypeName(obj.Object) = "ComboBox" Then
MsgBox obj.Name & obj.Object.Value
End If
Next 'obj
End Sub
'----------------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
"Broadband Al"
wrote in message
...
This is driving me crazy!!
I have a number of controls on a sheet. (Check boxes, option buttons and
combo boxes). I know that "cmbTitle.value" or "optBlue.value" sets/returns
what I want for an individual control but how do you refer to the controls in
a loop without using their individual names?
ie I want a macro to loop through the controls and return or set the
controls' values to/from an array. I have been using:
thisworkbook.sheets(s).OLEobject(x)...... where x=the control's name.
This works for pulling up their names etc. but "OLEobject" does not have a
"value" property. While about it, how do you return the type of a control ie
whether it is a combo of check box?
Please help...... I don't have much hair left!