Data Errors
Matrix Data Errors
Data in the MATLAB® or Microsoft® Excel® workspaces may produce the following errors.
Data Errors
Data Error | Cause | Solution |
---|---|---|
Excel worksheet cells must contain only numeric or string data. | ||
You used quotation marks around the data-location argument in
| Correct the syntax to remove quotation marks. | |
Correct the macro; you may have typed the variable name incorrectly. | ||
VBA matrix is empty. | You referenced a nonexistent MATLAB variable in | Correct the macro; you may have typed the variable name incorrectly. |
Errors When Opening Saved Worksheets
This section describes errors that you may encounter when opening saved worksheets.
When you open an Excel worksheet that contains Spreadsheet Link™ functions, the Excel software tries to execute the functions from the bottom up and right to left. Excel may generate cell error messages such as
#COMMAND!
or#NONEXIST!
. This is expected behavior. Do the following:Ignore the messages.
Close MATLAB figure windows.
Execute the cell functions again one at a time in the correct order by pressing F2, and then Enter.
If you save an Excel worksheet containing Spreadsheet Link functions, and then reopen it in an environment where the
excllink.xlam
add-in is in a different location, you may see the message:This document contains links: Re-establish links?
To address this issue, do the following:
Click No.
Select Edit > Links.
In the Links dialog box, click Change Source.
In the Change Links dialog box, select
matlabroot
\toolbox\exlink\excllink.xlam
.Click OK.
The Excel software 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.
In the Links dialog box, click OK.
The worksheet now connects to the Spreadsheet Link add-in.
Or, instead of using the Links menu, you can manually edit the link location in each affected worksheet cell to show the correct location of
excllink.xlam
.