Main Content

MLOpen

Description

example

= MLOpen() starts MATLAB® process. Use MLOpen to restart the MATLAB session after you have stopped it with MLClose in a given Microsoft® Excel® session. Use this syntax when working directly in a worksheet.

MLOpen starts MATLAB process. Use MLOpen to restart the MATLAB session after you have stopped it with MLClose in a given Microsoft Excel session. Use this syntax in a VBA macro.

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

Examples

collapse all

Start a MATLAB session from a worksheet:

MLOpen()

Output Arguments

collapse all

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

Tips

  • If a MATLAB process has already started, subsequent calls to MLOpen do nothing.

  • To start a MATLAB session and initialize the Spreadsheet Link™ software, use matlabinit rather than MLOpen.

  • To work with VBA code in Excel with Spreadsheet Link, you must enable Spreadsheet Link as a reference in the Microsoft Visual Basic® Editor. For details, see Installation.

Version History

Introduced before R2006a