2

I’m trying to create a COM User Defined Function automation add in for Excel 2003/2007/2010 and create a setup program that will install the add-in without the error message “Cannot find add-in ‘mscoree.dll’. Delete from list?” occurring when the automation add-ins added to excel. This error occurs when running the setup program on PCs other than the development PC.

Using this example by Eric Carter combined with this Stack overflow answer. I have tried both methods of registering both the custom dll and mscoree.dll. Solutions for this problem are well described in both of those links however neither the registry edit of the setup program described in the stackoverflow link nor the code from the other link that should register mscoree.dll works for me when installing with a setup project on another PC (64 bit Windows 7 PC not used for building the program). (In fact the last comment on the Stack overflow link is a person with the exact same problem that I am describing here.) The add-in does work, I just want to prevent the error message.

Community
  • 1
  • 1
neil860208
  • 167
  • 3
  • 11
  • Pretty mysterious, I can't guess where that message comes from. The custom registration functions listed in those links are trouble, they don't register enough. They are only needed to write one extra registry value, "Programmable". I'd have to recommend you use the normal Register property in the setup project and simply add that one registry value in the setup project. – Hans Passant Nov 01 '11 at 23:31

2 Answers2

3

I had this issue before and I noticed, through some experiments, that we must specify full path for the default value of InprocServer32 key in order to avoid seeing missing dll error message.

For 32-bit OS: the value is C:\Windows\System32\mscoree.dll

For 64-bit OS: the value is C:\Windows\SysWOW64\mscoree.dll

In C#, you can use the following code , Environment.GetFolderPath(Environment.SpecialFolder.SystemX86) or Environment.SystemDirectory to get the path to the system folder.

The key, Programmable, is also used for listing your add-in in the automation server. Without it, you will not be able to find your add-in there.

woodykiddy
  • 6,074
  • 16
  • 59
  • 100
  • I can confirm this is the solution, I've been having this problem as of late myself and this fixed it. –  May 23 '12 at 22:33
0

I have knocked my head 100 times to get this fixed completely. unfortunately end up with a solution which might be slightly dirty but it works....

So in your "Commit" event of your MSI, just link a VBS script below to run, and this will fix this issue once for all.

Const HKLM = &H80000002
strComputer = "."

Set RegistryObject=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Classes\CLSID\{<guid>}\InprocServer32"

strValueName =""

strValue = "C:\windows\system32\mscoree.dll"

RegistryObject.SetStringValue HKLM, strKeyPath, strValueName, strValue
Syed Siraj Uddin
  • 583
  • 1
  • 5
  • 13