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

H

Hans-Georg Michna

I have expanded a nicely working Outlook 2003 add-in, written in
Visual Basic 6.0, and added a second designer for Word next to
the already working one for Outlook. I renamed the first one to
ConnectOutlook and the second one to ConnectWord.

The add-in works perfectly well in debug mode with both Outlook
and Word. But when I install it and let my installer add the new
registry key and its four values, identical to the ones I see in
debug mode, I now get the error message in the add-in dialog of
Outlook and Word, "Not loaded. A runtime error occurred during
the loading of the COM Add-in."

When I open the COM Add-ins dialog in Outlook or Word, I see the
add-in, but it is unchecked. Underneath the dialog shows me the
location, which is the one into which the DLL was compiled,
rather than the one where it resides (Documents and
Settings\username\Application Data\Microsoft\AddIns with the
current user name replacing username), followed by the
aforementioned error message. In Word I have also seen squares
and Chinese characters in the location field, which raises the
suspicion that there is something wrong with the location.
However, the location isn't given anywhere. I don't know where
Outlook and Word take it from. The DLL file is exactly where it
should be.

When I search the registry for that wrong location, I find
several class and interface registrations for the add-in. When I
delete all of these and open Outlook again, the add-in dialog
still shows my add-in, but now with a location of all squares
(undisplayable characters). When I delete all class and
interface entries that contain the name of the add-in, Outlook
no longer shows the add-in in its add-in dialog. That behavior
is different from what it was before. I get the feeling that I'm
unable to install the add-in automatically, I can only install
it manually through the Outlook or Word add-in dialog. That
would be very bad.

When I remove the add-in and add it again, it always works, but
I don't want the user to have to do that. It's also rather
awkward in Word, because one has to add the COM Add-in command
to the menu first.

All this seems to indicate that the add-in itself is perfectly
correct, and that the problem is with Office, perhaps mistakenly
remembering an earlier version. It would be very difficult or
impossible to teach the installer a trick like cleaning the
registry.

On another computer, that's only seen a two weeks earlier
version of this add-in, the add-in doesn't even show up in the
dialog, but can still be added manually. Haven't had the chance
to try an unrelated computer that's never seen this add-in.

All the documentations say that I can add as many designers as I
want and I apparently have to add one designer for each version
of each Office application. Seems a bit strange and awkward to
me. Any improvement on that? But the question is whether these
procedures really work. Of course I may also have made some
stupid mistake somewhere.

Any ideas?

Hans-Georg
 
K

Ken Slovak - [MVP - Outlook]

Outlook doesn't like addins shared with other Office applications. I combine
Word/Excel/PPT addins in one but always make my Outlook addins separate
compilations.
 
H

Hans-Georg Michna

Outlook doesn't like addins shared with other Office applications. I combine
Word/Excel/PPT addins in one but always make my Outlook addins separate
compilations.

Ken,

thanks for your reply! You picked up my message, which I believe
I had quickly retracted.

I suffered from a stupid misconception. For some reason I
thought I wouldn't have to use regsvr32 for distribution, and on
some test computers I actually didn't, because I didn't know
that the DLLs are auto-registering and these registrations
survive my uninstaller.

Now I know more about CLSID, Interface, and Typelib
registrations and use regsvr32, which, however, creates entirely
new problems.

Hans-Georg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top