This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

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




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.


The MATLAB software does not recognize the command in an MLEvalString function. The command might be misspelled.

Verify the spelling of the MATLAB command. Correct typing errors.


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.


You entered an illegal variable name.

Make sure to use legal MATLAB variable names. MATLAB variable names must start with a letter followed by up to 30 letters, digits, or underscores.


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

Make sure to use the supported MATLAB data types.


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.


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

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


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.


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.


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.


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.


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.


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.


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.

Was this topic helpful?