' /** ' * pushArray ' * add Value to the Array ' * @param Array ' * @param Value ' * @return Ubound of the Array ' */ Public Function pushArray(ByRef ioArray As Variant, ByRef iItem As Variant) As Long Dim nextI As Long On Error Resume Next: ReDim Preserve ioArray(UBound(ioArray) + 1) If Err.Number <> 0 Then ReDim ioArray(0) Err.clear End If On Error GoTo 0 If IsObject(iItem) Then Set ioArray(UBound(ioArray)) = iItem Else ioArray(UBound(ioArray)) = iItem End If pushArray = UBound(ioArray) End Sub