A question about mixing On Error and Throw

O

Oenone

I have a piece of code (which I can't change) that uses On Error for its
error handling. It calls into a piece of code in another assembly that
Throws an exception.

Is there any way in my On Error error handler to determine the stack trace
between where the code is executing and where the exception was thrown? Or
even just the name of the class and procedure in which the exception was
thrown?

As far as I can see there's no way to determine this (there are no
properties of the Err object that tell me, and I don't have an Exception
object to query), is there some clever alternative that I've missed?

Thanks,
 
O

Oenone

Oenone said:
Is there any way in my On Error error handler to determine the stack trace
between where the code is executing and where the exception was thrown?

Found it now -- the Err object now has a GetException property that returns
the thrown Exception object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top