MATLAB: How to register a DLL created using Builder for Excel, so that the DLL information gets stored in the HKEY_CURRENT_USER registry key

accessactivexcomhkcuhkey_classes_roothkey_local_machinehklmlimitedlocalMATLAB Builder EXnenetrightsuser

I would like to be able to register a DLL created by Builder for Excel without administrator privileges, for this I need to store the DLL information in the HKEY_CURRENT_USER registry key.

Best Answer

This enhancement has been incorporated in Release 2011a (R2011a). For previous product releases, read below for any possible workarounds:
Please follow these instructions, In order to be able to register the DLL by using the HKEY_CURRENT_USER registry key:
1) Let's assume that you have compiled a component called "xlmulti.xlmulticlass".
2) First you will need to register this DLL once on a test PC, normally using regsvr32.exe yourfile.dll.
3) Now open Regedit and navigate to the key HKEY_CLASSES_ROOT.
4) Search for the key xlmulti.xlmulticlass, which should be located there.
5) While the key xlmulti.xlmulticlass is selected, click on File -> Export and give the file a name such as "01.reg".
6) Now open the file with a text editor such as Notepad.
7) At the beginning of the file you should see an entry such as {5595027C-F778-4D32-B073-A65A4AB02C25}, copy this number to your clipboard. This is the unique Class Id that identifies your component.
8) Now move back to the top of HKEY_CLASSES_ROOT and select it (the key).
9) Now search for the Class Id that you just copied to the clipboard.
10) Once you've found a key with the name of the Class Id under HKEY_CLASSES_ROOT, select the key and export it as done before, giving it a name such as "02.reg".
11) Now open the files 01.reg and 02.reg and replace all occurrences of "HKEY_CLASSES_ROOT" with "HKEY_CURRENT_USER\Software\Classes" (without the quotation marks).
12) Now run regsvr32.exe /u yourfile.dll to unregister your component.
13) Now paste the contents of 02.reg in the file 01.reg, excluding the header "Windows Registry Editor Version 5.00", so that you only have one file.
14) You can now use this file to register the DLL manually by double clicking on it and confirming the prompt.