
err.raise not trappable in class module
I am trying to trap errors raised in a class module. Here is an example of
the problem. Create a new class module named 'clsTest' with this function:
Public Function RaiseError()
Err.raise 1 ' How can the calling method trap this?
End Function
Call RaiseError from within an error trap as below:
Public Sub DoTest()
Dim myTest As New clsTest
On Error Resume Next ' On Error Goto fails to trap it also
Call myTest.RaiseError
Stop ' never executes stop
End Sub
I need to trap the err.raise in the calling method. Can someone help?
Thanks in advance.
ce huff