Here is what I use quite successfully...
1. The very first line of code to run should be:
AddHandler Application.ThreadException, AddressOf
modGlobal.OnThreadException
2. In a standard module called modGlobal, add a method called
OnThreadException that looks like this:
Public Sub OnThreadException(byval sender as object, byval t as
System.Threading.ThreadExceptionEventArgs)
dim exp as Exception = t.exception
dim strMsg as string
strMsg = String.Format("We're sorry, an untrapper error occurred.{0}The
error messaged was:{0}{1}",vbcrlf,exp.ToString)
msgbox(strMsg)
End Sub
--
**************************************
Andrés Becerra
Pennsylvania, USA
Email not posted due to email stealing A**H***S that poll newsgroups.
**************************************
"Stu" <st****@ntpcl.uk.com> wrote in message
news:#R*************@TK2MSFTNGP10.phx.gbl...
Hi,
Is there any way to catch every exception raised in an application (in
order to write it to a log file for example).
Thanks in advance,
Stu