| Contents | Index |
| On this page… |
|---|
Automatically Starting the Spreadsheet Link EX Software Manually Starting the Spreadsheet Link EX Software |
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.
To start the Spreadsheet Link EX and MATLAB software manually from the Excel interface:
Click Tools > Macro. (In Excel 2007, click the View tab or the Developer tab, and then click the Macros button.)
Enter matlabinit into the Macro Name/Reference box.
For more information about the matlabinit function, see Function Reference.
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 there are several versions of MATLAB 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 Using Particular Versions of MATLAB. |
To connect a new Excel session to already running MATLAB session:
In MATLAB, enter the following command:
enableservice('AutomationServer', true)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:
matlab -automation
This command does not start MATLAB in a full desktop mode. To start MATLAB in a full desktop mode, 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:
Right-click your MATLAB shortcut icon. (You can use the icon on your desktop or in the Windows Start menu.)
Add the string -automation in the Target field. Remember to leave a space between matlab.exe and /automation.
Click OK.
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 functions 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.
![]() | Customization | Using MATLAB Functions in Microsoft Excel | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |