
09-28-2007, 12:05 PM
|
|
Contributor
* Expert *
|
|
Join Date: Mar 2004
Posts: 614
|
|
The error is not ignored, it's directed to the specified handler.
Now your handler can do what it wants with the error. Log it, notify the user, try fixing the problem itself.
Errors should not be ignored...
To recieve information about errors in a subroutine you can use a return value from the function to determine success or error specification.
Note that an 'On Error' statement is effective for subroutines called from the main procedure containing the statement.
Example: (run the following and see what happens)
Code:
Sub Main()
On Error GoTo errH
Debug.Print SubSub
Exit Sub
errH:
Debug.Print Err.Number, Err.Description
End Sub
Function SubSub() As Boolean
Debug.Print 1 / 0
SubSub = True
End Function
|
|