title: vba - checking for empty array
body: <pre><code>Function IsVarArrayEmpty(anArray As Variant)
  
  Dim i As Integer
  
  On Error Resume Next
      i = UBound(anArray, 1)
  If Err.Number = 0 Then
      IsVarArrayEmpty = False
  Else
      IsVarArrayEmpty = True
  End If
  
  End Function
  </code></pre>
  
  <p>It is returning true for uninitialized and false for initialized. I want to see if it has any data/content. However, the problem is I feel the above code is returning false even when there is no data in the array. How do I check that? </p>
  
  <p>(I tried setting string s equal to the byte array. That was "". That means the array is empty, right?)</p>