Main Content

Worksheet Cell Errors

You might see these error messages displayed in a worksheet cell.

The first column contains worksheet cell error messages. The error messages begin with the number sign (#). Most end with an exclamation point (!) or with a question mark (?).

Worksheet Cell Error Messages 

Error Message

Meaning

Solution

#COLS>#MAXCOLS!

Your MATLAB® variable exceeds the Microsoft® Excel® limit of #MAXCOLS! columns.

This is a limitation in the Excel product. Try the computation with a variable containing fewer columns.

#COMMAND!

This error message represents any error that appears at the MATLAB command line. You can show the full error message from the MATLAB command line by using the MLShowMatlabErrors function. Or, you can set the corresponding preference in the Preferences dialog box available from the MATLAB group on the Excel Home tab.

Troubleshoot the MATLAB error.

#DIMENSION!

You used MLAppendMatrix and the dimensions of the appended data do not match the dimensions of the matrix you want to append.

Verify the matrix dimensions and the appended data dimensions, and correct the argument. For more information, see the MLAppendMatrix reference page.

#INVALIDNAME!

You entered an invalid variable name.

Ensure that you use valid MATLAB variable names. MATLAB variable names must start with a letter, followed by letters, digits, or underscores. For details, see Variable Names.

#INVALIDTYPE!

You specified an illegal MATLAB data type with MLGetVar or MLGetMatrix.

Make sure to use the supported MATLAB data types.

#MATLAB?

You used a Spreadsheet Link™ function and no MATLAB software session is running.

Start the Spreadsheet Link and MATLAB software. See Start and Stop Spreadsheet Link and MATLAB.

#NAME?

The function name is unrecognized. The excllink.xlam add-in is not loaded, or the function name might be misspelled.

Be sure the excllink.xlam add-in is loaded. See Add-In Setup. Check the spelling of the function name. Correct typing errors.

#NONEXIST!

You referenced a nonexistent matrix in an MLGetMatrix or MLDeleteMatrix function. The matrix name might be misspelled.

Also, you receive the #NONEXIST! error when you attempt to use matlabfcn to obtain an output.

Verify the spelling of the MATLAB matrix. Use the MATLAB whos command to display existing matrices. Correct typing errors.

#ROWS>#MAXROWS!

Your MATLAB variable exceeds the Excel limit of #MAXROWS! rows.

This is a limitation in the Excel product. Try the computation with a variable containing fewer rows.

#SYNTAX?

You entered a Spreadsheet Link function with incorrect syntax. For example, you did not specify double quotation marks ("), or you specified single quotation marks (') instead of double quotation marks.

Verify and correct the function syntax.

#VALUE!

An argument is missing from a function, or a function argument is the wrong type.

Supply the correct number of function arguments, of the correct type.

#VALUE!

A macro subroutine uses MLGetMatrix followed by MatlabRequest, which is correct standard usage. A macro function calls that subroutine, and you execute that function from a worksheet cell. The function works correctly, but this message appears in the cell.

Since the function works correctly, ignore the message. Or, in this special case, remove MatlabRequest from the subroutine.

#INVALIDRANGE!

The named range is defined incorrectly, or the named range spans multiple worksheets.Select a range of data on only one worksheet and create an appropriate name for the range of data. For instructions about defining names, see Excel Help.

Note

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 might generate cell error messages such as #COMMAND! or #NONEXIST!. This is expected behavior, so ignore the messages and do the following:

  1. Close the MATLAB figure windows.

  2. Execute the cell functions again one at a time in the correct order by pressing F2, and then Enter.