• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Why does not the function return property of the object?

Wilker12

New Member
Hello,
If the function returns the object property of the 1st form, how to make it also return from the 2nd?

1st form:
Code:
Function ValueOfCheckBox()
    ValueOfCheckBox = OLEObjects("CheckBox1").Object.Value
End Function
MsgBox ValueOfCheckBox

2nd form:
Code:
Function ValueOfCheckBox()
    ValueOfCheckBox = OLEObjects("CheckBox1").Object
End Function
MsgBox ValueOfCheckBox.Value

Thanks.
 
The second form is returning the Object, where the first form is returning the Value property of the Object

The object may have several other properties apart from just Value, ie: background Color, Font Color, Top, Left, Font type etc

The first form specifies what is wanted ie?: The Value
 
Back
Top