Getting Add-Ins to load at startup

C

Carlos

I managed to create a sample Add-in for Excel with a toolbar. This
was painful requiring me to try all kinds of tricks until finally
adding Office.dll to the Global Assembly Cache in my setup project did
the trick (I discovered this by catching all Exceptions in the
debugger and figuring out the rest from the online discussions).

Now I've added a bunch of my own code and the thing just wont load
(OnConnection is never reached). No exceptions are being thrown this
time. The registry entry
HKLM\Software\Microsoft\Office\Excel\Addins\myAddin\LoadBehavior stays
set to 3. There is a new registry query done on
HKLM\Software\Microsoft\Office\Excel\Addins\myAddin\FileName that
wasn't done with the sample Add-in. It fails to find this key
(NOTFOUND in regmon).

I've tried reloading the output DLL as an assembly (per
http://blogs.msdn.com/omars/archive/2004/04/28/122321.aspx), which
didn't help. I also read related discussions about setting the
Register property in the Setup project to vsdraCOM. However, this is
confusing since an primary output entry doesn't allow this value
(discussion: http://groups.google.com/groups?q=OnConnect+event+not+firing+vsdraCOM&ie=UTF-8&hl=en).

Help would be appreciated. It would also help if anyone can direct me
to a complete description of how this COM add-in loading occurs,
and/or perhaps some diagnostic techniques for figuring out what is
going on. It has been extremely difficult to approach a problem in
which "Hello World" doesn't even work at first out of the box.

Thanks,
Carlos
versions: .NET 1.1, OfficeXP, VisualStudio.NET 2003 (latest service
packs)
 
N

Nick

Hi,

I would agree that developing add-in for Office is quite painful as not
many resource are available.

Anyway, before looking into the detail of your problem, I would like to ask:

1. You said you never success to load the add-in, did you use the
share-addin wizard to make a simple add-in first?

The following tutorial which cover all steps by steps, I think most
people can get this work:

http://support.microsoft.com/defaul...port/kb/articles/q302/9/01.asp&NoWebContent=1

2. You said you have not-found in regmon, I got this problem too using
regmon. I don't know the reason. But the solution is to build again the
add-in using the above tutorial (steps by sptes) to make a simple add-in
first. Anyway, it works!


Nick
 
C

Carlos

Problem solved! So, I definitely had gotten the simpler demos to
work. The problem was when I added my custom stuff with extra
libraries, it seemed to break down for no aparent reason. I went back
to add things one by one to isolate exactly what broke down. Turns
out I tried changing the registered name from

[GuidAttribute("12B22828-5CDD-4AED-B888-4AE8B84ED7B3"),
ProgId("MyProjName.Connect")]
public class Connect : Object, Extensibility.IDTExtensibility2
{

to:

[GuidAttribute("12B22828-5CDD-4AED-B888-4AE8B84ED7B3"),
ProgId("com.myorg.MyProjName.Connect")]
public class Connect : Object, Extensibility.IDTExtensibility2
{

Then it seemed to want to look up the file name
com.myorg.MyProjName.dll in the FileName registry setting to find the
Connect class. I haven't actually confirmed that's how it works; I
just switched it back. Too much Microsoft black magic for me. I
should have stuck with Java development (or perhaps studied finance in
college).

Thanks,
Carlos
 

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