Private Sub Command1_Click()
Dim a()
Debug.Print ismalloc(a)
ReDim a(10)
Debug.Print ismalloc(a)
End Sub
Private Function ismalloc(ByRef a()) As Boolean
On Error GoTo errhandle
Dim i As Integer
i = UBound(a)
ismalloc = True
Exit Function
errhandle:
Err.Clear
ismalloc = False
End Function
On Error GoTo ErrHandle
c = UBound(b)
IsDimed = True
Exit Function
ErrHandle:
IsDimed = False
End Function
Private Sub Command1_Click()
On Error GoTo ErrHandle
MsgBox IsDimed(a())
Debug.Print 1 / 0
ReDim a(10) As Integer
MsgBox IsDimed(a())
Exit Sub
ErrHandle:
MsgBox "Oop!"
Resume Next
End Sub