Name
IsEmpty Function
Syntax
IsEmpty(varname)varnameUse: Required
Data Type: Any
A numeric or string expression.
Return Value
Boolean (True or False).
Description
Determines whether the variable has been initialized by having
an initial value (other than Empty) assigned to it.
Rules at a Glance
If the variant passed to IsEmpty has not been initialized,
Trueis returned; otherwise, IsEmpty returnsFalse.Although IsEmpty can take an expression as the value of
varname, it always returnsFalseif more than one variable is used in the expression. IsEmpty is therefore most commonly used with single variables.
Programming Tips and Gotchas
When passed an object variable that has been set equal to
Nothing, the IsEmpty function returns False. Hence, the function should not be
used to test whether a previously initialized object variable now
holds a valid object reference.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access