function myfunc(args1, arg2, optional calledfrom as string)
...
...
...
error_handler:
if not ismissing(calledfrom) then
msgbox("error: " & err & " Desc: " & err.description & vbcrlf & vbcrlf & _
"function was called from " & calledfrom)
else
msgbox("error: " & err & " Desc: " & err.description & vbcrlf & vbcrlf & _
"no details of calling source")
end function