This error may occur if MATLAB is not set up correctly to communicate with Excel. To rectify this, you need to:
a) Register MATLAB as a COM server to be used with Excel.
b) Ensure the correct Add-in is loaded into Excel and selected.
To register a certain MATLAB version as the default server, execute the following command in the MATLAB Command Window of your desired version, as specified in the related article:
Why is the wrong MATLAB version started when using Excel Link?
Equivalently, you can execute the following in the Windows Command Prompt. Please note you must be logged in with administrator privileges to run this command:
C:\Program Files\MATLAB\R20XXx\bin\win64\matlab.exe -regserver
To ensure the correct Add-in for this version of MATLAB is loaded into Excel, follow the instructions in the link below:
The configuration of Excel with MATLAB will vary based upon the version of Microsoft Office/Excel you have installed. Please refer to the directions for your version of Excel in the walkthrough (linked above).
Best Answer