grrrr !
How do I test if an optional parameter as been passed to a function if the parameter is an Object ?
I know I can use IsEmpty for Variables, but objects ???
Thanks
Printable View
grrrr !
How do I test if an optional parameter as been passed to a function if the parameter is an Object ?
I know I can use IsEmpty for Variables, but objects ???
Thanks
Instead of defining the Optional Parameter as Object, use Variant then you can use the IsMissing command, i.e.Code:Sub SomeSub(ByVal sString As String, Optional oObject As Variant)
If IsMissing(oObject) Then MsgBox "No Object Passed"
End Sub
Private Sub Command1_Click()
Call SomeSub("Anything")
End Sub
Ah that's what I wanted ISMISSING !!!
The only thing is that I pass a control ( progrss bar ) to my function (it's a class thing, don't bother with that).
So I'll try IsMissing with controls to see if it works...
Thanks