Documentation Center

  • Trials
  • Product Updates

MLShowMatlabErrors

Return standard Spreadsheet Link EX errors or full MATLAB errors using MLEvalString

Syntax

MLShowMatlabErrors(flag)
MLShowMatlabErrors flag
out = MLShowMatlabErrors(flag)

Description

MLShowMatlabErrors(flag) sets the Spreadsheet Link™ EX error display mode when executing MATLAB® commands using MLEvalString. Use this syntax when working directly in a worksheet.

MLShowMatlabErrors flag sets the Spreadsheet Link EX error display mode when executing MATLAB commands using MLEvalString. Use this syntax in a VBA macro.

out = MLShowMatlabErrors(flag) lets you catch errors when executing MLShowMatlabErrors in a VBA macro. If MLShowMatlabErrors fails, then out is a string containing error code. Otherwise, out is 0.

Input Arguments

flag

Either "yes" or "no".

Specify "yes" to display the full MATLAB error string upon MLEvalString failure. Specify "no" to display the standard Spreadsheet Link EX errors upon MLEvalString failure.

Default: "no"

Output Arguments

out

0 if the command succeeded. Otherwise, a string containing error code.

Examples

expand all

Switch to Displaying Spreadsheet Link EX Errors

Switch to displaying standard Spreadsheet Link EX errors, such as #COMMAND, on MLEvalString failures:

MLShowMatlabErrors("no")

Switch to Displaying MATLAB Errors

Switch to displaying MATLAB error strings, such as ??? Undefined function or variable 'foo', on MLEvalString failures:

MLShowMatlabErrors("yes")

See Also

Was this topic helpful?