This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

Handle Errors During a Method Call

If your application generates an error while creating a class instance or during a class method call, the current procedure creates an exception.

Microsoft® Visual Basic® provides an exception handling capability through the On Error Goto <label> statement, in which the program execution jumps to <label> when 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 ErrObject object in the current context in a variable called Err.

See the Microsoft Visual Basic documentation for a detailed discussion on Visual Basic error handling.

Was this topic helpful?