0

Is there something else I have to do to get a message with an error occurs other than this:

On Error GoTo Handler
'Code that will cause an error
Handler:
msgBox(Err.Description)

The Handler gets thrown but it is empty.... Just a message box comes up with no text.

4
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by Jx_Man
1

Just from looking at what you have, you are entering the error handler when no error actually exists (e.g. err.code=0). Try exiting your routine just before the handler.

On Error GoTo Handler

'Code that will cause an error

'Expected exit
Exit Sub 

Handler:
msgBox(Err.Description)
Votes + Comments
Suggestion worked.
2

yup, do as techtix and debasisdas said...
you need to exit the procedure or function first then go to handler.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.