Err.Number does not work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get a zero and a blank when I write err.number and err.description into my
error MsgBox.
If I write error$ I get a message with no number.
There wa a similar question posted on 11/21 and I tried the suggested
solution to no avail.
Thank you for your consideration.
 
I'm not sure why the Err.Description doesn't work
I just use Err to get the number, and Error to get the description.
 
Thanks, Ofer. That worked just fine.

Ofer said:
I'm not sure why the Err.Description doesn't work
I just use Err to get the number, and Error to get the description.
 
George R said:
I get a zero and a blank when I write err.number and err.description
into my error MsgBox.
If I write error$ I get a message with no number.
There wa a similar question posted on 11/21 and I tried the suggested
solution to no avail.
Thank you for your consideration.

It sounds like you're accessing the Err object when there's no error, or
the original error has been cleared. Please post the relevant code.
 
Normally you code like this:

Exit Sub
Catch:
MsgBox Err.Number & ": " & err.description
End Sub

If you accidentally loose the "Exit Sub" line you will get
the problem you are reporting.

(david)
 
Back
Top