Search code examples
office-interopoffice-addinsexcel-addins

Where is the latest version of the Office COM AddIn shim code?


We're still using the shim code that was put out in 2010 (when we first got 64-bit Office). Is there a newer version that Microsoft posted?

If so, where can I find it?

Additional Info: An AddIn written in C#, even if signed, is not viewed as signed by Office. Office sees the AddIn as the .NET wrapper DLL (mscoree.dll I think) and is looking to see if that is signed.

So someone on the Office team write a C++ shim. It's sole purpose is to be the AddIn registered with Office and when loaded, call through to the actual .NET AddIn. As a native C++ app Office looks at it's digital signature to see if the AddIn is signed.


Solution

  • The last COMAddin Shim Wizard available is 2010, there isn't anything available since then that I can find. In 2016, this comprehensive Shim article still references the 2010 version.

    But I'm guessing your question is actually about how to sign an addin so it displays as signed in Office Addins dialog window?

    To do that, you need to sign your shim.dll, then target the shim.dll location rather than the default mscoree.dll in the registry's CLSID key.

    Office looks for all addins listed in the Software\Microsoft\Office\OFFICEAPPNAME\Addins\[Addin.name] registry (or equivalent 32bit WOW6432Node node), then gets the CLSID from HKCR\[Addin.Name]\CLSID, then in HKCR\[CLSID] loads the dll located from there. When it does that, it will recognize your shim.dll and its signature, rather than the unsigned .NET mscoree.dll on your target computer.