Is it possible to give Err to a subroutine?

C

Cecil Westerhof

I would like to use an error function. The first part would be:

Sub EmitError(FunctionCode, Error, ExtraInfo) on error resume next ErrorStr
= Error.Description & "<br/>" & _
Error.Source & "<br/>" & _
Error.number & "<br/>" & _
ExtraInfo


And I would like to call it with:
EmitError "S000101", Err, ""

But when the function is called Error is resetted. Is there a way I could
get this working? It should be called from a lot of places and I would not
like to make in al these places the string instead of in the function.
 
C

Cecil Westerhof

Ray at said:
Take the On Error Resume Next out of this sub and see what happens.

I put it after setting ErrorStr and now it works okay. I need the 'On Error
Resume Next' because I do some cleaning up in the subroutine and do not want
an error from this to be displayed.
 

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

Members online

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top