MATLAB: Do I receive “Error in .Cla​ss1.1_0″ in Excel while using dll generated from MATLAB Builder EX in R2013b

MATLAB Builder EX

I am able to see the function in Excel but when I execute the function, I encounter the error "Error in <Component_name>.Class1.1_0" in Excel.
 

Best Answer

This is caused by "mwcomutil.dll" and "mwcommgr.dll" files not being registered. Please follow the steps below in order to register the dlls.
For 64 bit MATLAB
Development machine:
regsvr32 <matlabroot>bin\win64\mwcommgr.dll
regsvr32 <matlabroot>bin\win64\mwcomutil.dll
regsvr32 <project_dll_dir>\projectdll_1_0.dll
Deployment machine:
regsvr32 <mcrroot>\runtime\win64\mwcommgr.dll
regsvr32 <mcrroot>\win64\mwcomutil.dll
regsvr32 <project_dll_dir>\projectdll_1_0.dll
  For 32 bit MATLAB
Development machine:
regsvr32 <matlabroot>\bin\win32\mwcommgr.dll
regsvr32 <matlabroot>\bin\win32\mwcomutil.dll
regsvr32 <project_dll_dir>\projectdll_1_0.dll
Deployment machine:
regsvr32 <mcrroot>\bin\win32\mwcommgr.dll
regsvr32 <mcrroot>\bin\runtime\win32\mwcomutil.dll
regsvr32 <project_dll_dir>\projectdll_1_0.dll
 
Please make sure to use 32 bit MATLAB with 32 bit Version of Microsoft Excel and 64 bit MATLAB with 64 bit version of Microsoft Excel.