COM addin not loading for MS Word

Add-in Express™ Support Service
That's what is more important than anything else

COM addin not loading for MS Word
Not loaded. A runtime error occurred during the loading of the COM... 
Michael McMahon




Posts: 56
Joined: 2005-05-03
Hi there,

I'm working on an addin for Office 2003 (Outlook, Word, Excel) but am having trouble with Word. The problem seems to be that the addin won't run safely in Word. It seems that Word is disabling or unloading the COM Addin because there's an error occuring when it runs. I say this because when I go to Tools -> COM Add-Ins (on the menu) I see that my addin is available but not ticked. the comment next to the Load Behaviour says:

Not loaded. A runtime error occurred during the loading of the COM Add-in.

This addin has worked in the past and I'm not sure what could be going on with it which is why I thought I'd ask for your help. If you could provide any thoughts on how to debug the problem it would be much appreciated.

A point of note, when I tick the checkbox next to the addin in the COM Add-In management interface, the addin does load and I can use the toolbar button, etc... However the fact that the addin isn't loading at startup means that I can't debug it in Visual Studio 2003.
Posted 20 Mar, 2006 23:49:57 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Michael.

Do you have both .NET Framework v1.1 and v2.0 installed on your PC?
Posted 21 Mar, 2006 13:39:30 Top
Michael McMahon




Posts: 56
Joined: 2005-05-03
Hi Sergey,

Yes I do have both .NET frameworks installed. As I am using VS Studio 2003 and VS Studio 2005. Though for the add-in-express development I'm just using VS Studio 2003.


Mike
Posted 21 Mar, 2006 16:27:52 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Michael.

In this case you should use the 'Host configuration' dialog to configure Office applications to load .NET v1.1.4322 (right click on the addinmodule and choose the 'Host configuration' option).

Also you can use C++ shim for the add-in. In this case you don't need the configuration dialog because the shim is configured in the code.
Posted 22 Mar, 2006 06:27:52 Top
Michael McMahon




Posts: 56
Joined: 2005-05-03
Hi All,

Thought I'd post the resolution to this issue. Check the following registry keys:

HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\<The Add-in progID>

and

HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Word\Addins\<The Add-in progID>

I found that the LoadBehaviour specified in the HKCU section was 3 but HKLM was set to 2. When I set the HKLM loadbehaviour flag to 3 the addin worked again.

It would seem that the HKLM loadbehaviour flag takes precedence over the HKCU flag.

Thanks Sergey for helping me sort this out!
Posted 29 Mar, 2006 17:47:26 Top