vba error handling from one procedure for all functions

225 Views Asked by At

My question is here about possibility of another(short) way solution;

In vba I have a procedure, which call numerous functions, and in that functions some of them also other functions. I need a universal error handler, which exits sub and writes err.Description to screen.

I know how to write it on each function.

On Error GoTo errorhand
'block of code
Exit Sub(function)
errorhand:
MsgBox Err.Description
Exit Sub
End Sub(function)

Is there any way, other than to write these piece of code on each function? (Due to each error opens in specific function, I donot think writing this code to main procedure will lead to error handler to show up in every function where error happens)

0

There are 0 best solutions below