How to check if an array is empty in VBA?
<p>I have a function, which checks whether the array is empty or not. Since today I'm getting an runtime error 9. I don't know why.</p>

<p>Here is the code:</p>

<pre><code>When db table contains data, pass it to the variable =&gt; arrItems
arrItems as Variant
ArrEmpty as Boolean

With rs
  If Not .EOF Then
      arrItems = .GetRows
      .Close
  End If
End With

ArrEmpty = IsArrayEmpty(arrItems) 

Private Function IsArrayEmpty(parArray As Variant) As Boolean
    IsArrayEmpty = IIf(UBound(parArray) &gt; 0, False, True) //Here is invoked the runtime error 9
End Function
</code></pre>

<p>How can I check if the array is empty?</p>