Main Content


Initialize Spreadsheet Link and start MATLAB



matlabinit initializes the Spreadsheet Link™ software and starts MATLAB®. If the Spreadsheet Link software has been initialized and MATLAB is running, subsequent invocations do nothing. Use matlabinit to start Spreadsheet Link and MATLAB sessions manually when you have set the MLAutoStart preference to no. If you set MLAutoStart to yes, the matlabinit function executes automatically.


collapse all

While you use Microsoft® Excel®, initialize Spreadsheet Link and start MATLAB manually any time by using the Excel toolbar.

On the Developer tab, in the Code group, click Macros.

In the Macro name box, enter matlabinit and click Run.

Spreadsheet Link initializes and MATLAB starts. You can now use Spreadsheet Link to import data from MATLAB or export existing data in the worksheet into MATLAB and run MATLAB functions in Excel.


  • You can include the matlabinit function in a macro subroutine.

  • You cannot run the matlabinit function as a worksheet cell formula or in a macro function. matlabinit is a macro subroutine. Subroutines cannot run as functions in a worksheet cell. Only Excel functions can be run in a worksheet cell.

Alternative Functionality

You can execute MLOpen to start MATLAB.

Version History

Introduced before R2006a