I want to make a local version of IsEmpty()
in a class like this:
Public Dict As Dictionary
Public Function isEmpty(columnName As Variant) As Boolean
isEmpty = IsEmpty(Dict(columnName))
End Function
This is for information hiding, so that I can call
classInstance.isEmpty("someField")
instead of
isEmpty(classInstance.Dict("someField"))
and therefore not expose the class' internal data structure.
But the problem is that the version of isEmpty()
that I've declared seems to be overriding any reference to the VBA library version of IsEmpty()
, because it's generating an Out of stack
error and crashing Excel. I assume this is because the isEmpty = IsEmpty(...)
call is causing infinite recursion.
Is there a way that I can explicitly reference the standard version of IsEmpty()
that I would like to call here?
Yes. Explicitly reference the standard library.
VBA.IsEmpty()
Bonus:IsEmpty
actually belongs to the Information
object. A fully explicit call looks like this.
bool = VBA.Information.IsEmpty(var)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With