Excel Link | ![]() ![]() |
Tips and Reminders
These tips and reminders help you use Excel Link efficiently.
Syntax
MLPutMatrix
and mlputmatrix
are the same.
BONDS
, Bonds
, and bonds
are three different MATLAB variables. Standard MATLAB function names are always lower case, for example plot(f)
.
=mlputmatrix("a", C10)
MLDeleteMatrix("Bonds")
.
MLGetMatrix
, which has unique argument conventions).
Sheet3!B1:C7
or Sheet2!OUTPUT
.
Worksheets
0
. While a function is executing, the cell may continue to show the entered formula.
MLGetMatrix
in manual calculation mode, enter the function in a cell, then press F9 to execute it. However, pressing F9 in this situation may also re-execute other worksheet functions and generate unpredictable results.
=MLPutMatrix("bonds", D1:G26) + C1
When the value in cell C1
changes, Excel re-executes the MLPutMatrix
function. Be careful, however, not to create endless recalculation loops.
A1
cell Reference Style on the Excel Tools Options... General tab.
MLGetMatrix
and later insert or delete rows or columns, or move or copy the function to another cell, edit the argument to correct the addresses. Excel Link does not automatically adjust cell addresses in MLGetMatrix
.
Macros
EXCLLINK.XLA
and click OK. You may have to use Browse to find the EXCLLINK.XLA
file.
MLGetMatrix
in a macro subroutine, enter MatlabRequest
on the line after MLGetMatrix
. MatlabRequest
initializes internal Excel Link variables and enables MLGetMatrix
to function in a subroutine. For example,
Sub Get_RangeA() MLGetMatrix "A", "RangeA" MatlabRequest End Sub
Data Types
Dates
Saved Worksheets
#COMMAND!
, #NONEXIST!
, etc.). Such behavior is "normal" for Excel. Simply ignore the messages, close any MATLAB figure windows, and re-execute the cell functions one at a time in the correct order by pressing F2, then Enter.
EXCLLINK.XLA
add-in is in a different location, Excel may display a message box:Click No. Then pull down the Edit menu and select Links. In the Links window, click Change Source. In the Change Links window, find and select EXCLLINK.XLA
under C:\MATLAB\EXLINK
(or your path) and click OK. Excel executes each function as it changes its link. You may see MATLAB figure windows and hear error beeps as the links change and functions execute; ignore them. Back in the Links window, click OK. The worksheet now correctly connects to the Excel Link add-in.
Or, instead of using the Edit Links... menu, you can manually edit the link location in each affected worksheet cell to show the correct location of EXCLLINK.XLA
.
![]() | What the Functions Do | Using Excel Link | ![]() |