If your application generates an error while creating a class instance or during a class method call, the current procedure creates an exception.
Visual Basic® provides an exception handling capability
On Error Goto <label> statement,
in which the program execution jumps to
an error occurs. (
<label> must be located
in the same procedure as the
On Error Goto statement.)
All errors in Visual Basic are handled this way, including errors
within the MATLAB® code that you have encapsulated into a COM
object. An exception creates a Visual Basic
in the current context in a variable called
See the Microsoft Visual Basic documentation for a detailed discussion on Visual Basic error handling.