How is a function defined?
If it is ... As Object , then it is either a valid object or Null .
If it's ... As Variant (or not type), then everything can be passed, and you can check with IsEmpty() , IsNull() (Note, NOT a null object, but a null value) or IsObject() depending on of what exactly you want to check before checking ... Is Nothing .
If the parameter is Optional , you can use IsMissing() , but it must be a variant type without a default value.
Also, check out this article about the various uses of Null in VB.
source share