|On this page…|
When installed and configured according to the instructions in Add-In Setup, the Spreadsheet Link™ EX and MATLAB® software automatically start when you start a Microsoft® Excel® session.
Select Tools > Macro.
In Excel 2007, click the View or Developer tab, and then click the Macros button.
In Excel 2010, click the View menu and select Macros on the Excel toolstrip, and then click View Macros.
Enter matlabinit into the Macro Name/Reference field.
Click Run. The MATLAB Command Window button appears on the Microsoft Windows® taskbar.
By default, Spreadsheet Link EX starts a new MATLAB session. Alternatively, it can connect to an already running MATLAB session.
Note: If several versions of MATLAB are installed on your computer, Spreadsheet Link EX always uses the last registered version. If you try to connect to an already running MATLAB session that is not the last registered version, Spreadsheet Link EX starts a new MATLAB session rather than connecting to the existing one. See how to change the last registered version in Use Particular Versions of MATLAB.
To connect a new Excel session to an already running MATLAB session:
In MATLAB, enter the following command:
This command converts a running MATLAB session into an Automation server.
Start a new Excel session. It automatically connects to the running MATLAB session.
Alternatively, you can start MATLAB as an automation server from the beginning. To start MATLAB as an automation server, use the automation command-line option:
This command does not start MATLAB in a full desktop mode. To do so, use the -desktop option:
matlab -automation -desktop
If you always use MATLAB as an automation server, modify the shortcut that you use to start MATLAB:
MATLAB starts in the MATLAB root folder and completes the initialization. After starting, MATLAB changes to the Spreadsheet Link EX MATLAB startup folder. For details about specifying the startup folder, see MLStartDir.
If you started the Spreadsheet Link EX and MATLAB software from the Excel interface:
To stop both the Spreadsheet Link EX and MATLAB software, close the Excel session as you normally would.
To stop the Spreadsheet Link EX and MATLAB software and leave the Excel session running, enter the =MLClose() command into an Excel worksheet cell. You can use the MLOpen or matlabinit function to restart the Spreadsheet Link EX and MATLAB sessions manually.
If you connected an Excel session to an existing MATLAB session, close Excel and MATLAB sessions separately. Closing one session does not automatically close the other.