Wie um zu überprüfen, ob ein array leer ist, in VBA?

Ich habe eine Funktion, die prüft, ob das array leer ist oder nicht. Seit heute werde ich immer einen Laufzeitfehler 9. Ich weiß nicht, warum.

Hier ist der code:

When db table contains data, pass it to the variable => 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) > 0, False, True) //Here is invoked the runtime error 9
End Function

Wie kann ich überprüfen, ob das array leer ist?

InformationsquelleAutor yuro | 2016-08-05
Schreibe einen Kommentar