MATLAB: Does 32-bit MATLAB launch as COM Automation server using “Matlab.De​kstop.Appl​ication” even after unregistering the 32-bit MATLAB and registering the 64-bit MATLAB in MATLAB R2014a

32-bit64-bitcomMATLAB

Why does 32-bit MATLAB launch as COM Automation server using "Matlab.Dekstop.Application" even though I unregistered the 32-bit MATLAB and registered the 64-bit MATLAB in MATLAB R2014a?
 
I have both 32-bit and 64-bit versions of MATLAB R2014a installed on my machine and I could not launch 64-bit MATLAB R2014a as COM Automation server using ProgID "Matlab.Dekstop.Application". My application always launches 32-bit MATLAB as Automation server even though I unregistered the 32-bit MATLAB and registered the 64-bit MATLAB.

Best Answer

The reason this issue occurs is because your application launching MATLAB as Automation server is a 32-bit Application and prefers to check 32-bit Windows Registry entry under Wow6432Node. The 32-bit and 64-bit versions of MATLAB for each release use the same GUID, placed in the Windows Registry.
 
Note that this problem does not exist when switching between 32-bit and 64-bit versions of MATLAB if the release levels are different (i.e., 32-bit MATLAB R2013b and 64-bit MATLAB R2014a). This is due to the fact that the registry keys of each of these releases are unique.
 
Workaround:
This fix is for registering 64-bit MATLAB R2014a as COM Automation server when both 32-bit and 64-bit MATLAB are installed, and accessed using ProgID "Matlab.Dekstop.Application" only.
 
DISCLAIMER: Please note that this involves deleting a registry sub-key entry and it is not usually recommended to modify windows registries for trivial reasons. The user must have admin rights for this operation.
 
The following steps will guide you through implementing this workaround:
1. Open your 64-bit MATLAB as administrator. 
2. Download the attached file MATLAB_COM_64bit_Fix.p.
3. Navigate to the directory where the above file was downloaded.
4. Run the following line in MATLAB:
>> MATLAB_COM_64bit_Fix
Please note that you can regenerate the deleted sub-key entry by executing the command “regmatlabserver” in 32-bit R2014a MATLAB command window if you want to switch back to using 32-bit R2014a as COM Automation server.