Main Content

Data Errors

Matrix Data Errors

Data in the MATLAB®orMicrosoft®Excel®workspaces may produce the following errors.

Data Errors

Data Error

Cause

Solution

MATLAB matrix cells contain zeros (0).

Corresponding Excel worksheet cells are empty.

Excel worksheet cells must contain only numeric or string data.

MATLAB matrix is a 1-by-1 zero matrix.

You used quotation marks around the data-location argument inMLPutMatrixorMLAppendMatrix.

Correct the syntax to remove quotation marks.

MATLAB matrix is empty ([ ]).

You referenced a nonexistent VBA variable inMLPutVar.

Correct the macro; you may have typed the variable name incorrectly.

VBA matrix is empty.

You referenced a nonexistent MATLAB variable inMLGetVar.

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:

    1. Ignore the messages.

    2. Close MATLAB figure windows.

    3. Execute the cell functions again one at a time in the correct order by pressingF2, and thenEnter.

  • If you save an Excel worksheet containing Spreadsheet Link functions, and then reopen it in an environment where theexcllink.xlamadd-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:

    1. ClickNo.

    2. SelectEdit>Links.

    3. In the Links dialog box, clickChange Source.

    4. In the Change Links dialog box, selectmatlabroot\toolbox\exlink\excllink.xlam.

    5. ClickOK.

      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.

    6. In the Links dialog box, clickOK.

      The worksheet now connects to the Spreadsheet Link add-in.

    Or, instead of using theLinksmenu, you can manually edit the link location in each affected worksheet cell to show the correct location ofexcllink.xlam.