Excel addin does not load

Y

Yi

I created a VB.NET COM addin project which is set to load when Word or Excel
is launched. I set a debug breakpoint in the first line of method
Connect.OnConnection(). After I compiled the project with Visual Studio
2003, I found this addin does not load when Excel is launched (it is loaded
only when Word is launched). But when I create and compile such a project
with Visual Studio 2002, the addin will be loaded when either Word or Excel
is launched. This problem with VS 2003 occured recently and I don't know what
happened to either VS 2003 or Excel on my machine. Can anyone give me some
hint? I am realy fructrated with this - I reinstalled both Offce and Visual
Studio 2003 but the problem is still there.

Best wishs,
-Yi
 
B

Bernd

Yi said:
I created a VB.NET COM addin project which is set to load when Word or Excel
is launched. I set a debug breakpoint in the first line of method
Connect.OnConnection(). After I compiled the project with Visual Studio
2003, I found this addin does not load when Excel is launched (it is loaded
only when Word is launched). But when I create and compile such a project
with Visual Studio 2002, the addin will be loaded when either Word or Excel
is launched. This problem with VS 2003 occured recently and I don't know what
happened to either VS 2003 or Excel on my machine. Can anyone give me some
hint? I am realy fructrated with this - I reinstalled both Offce and Visual
Studio 2003 but the problem is still there.

Best wishs,
-Yi

Hi YI,

did you register your addin for both, Word and Excel, in the appropriate
registry section, for instance,
HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins
HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins?

In addition, are the methods of your addin thread save? (i.e. they
can be called by different processes simultaneously without producing
unexpected results)

Kind regards
Bernd
 
S

sk

Yi

Please see the topic in MSDN

"Migrating Add-in Solutions from Visual Studio .NET 2002 to Visual Studio

..NET 2003"

I didn't go through this but this could be an answer ^_^

Let me know if you still have the same problem.

Shinya
 
Y

Yi

Hi Bernd, the addin should be registered for both Word and Excel since when I
create the project, I selected these two applications for this addin to work
with. I checked the registry key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Excel\AddIns" and saw it has my
addin.

My addin does not contain any new method except those come with the create
project wizard, so it should not be a problem.

I found a weird thing - when I debugging the project that is created with
Visual Studio 2003, set Excel to be the "start external program", and set
breakpoint to the first line of method Connect.OnConnection() and press F5,
the cpp file containing this method that is created with Visual Studio 2003
is loaded and the debugger stoped at a breakpoint in this file!!!

I doubt there might be something wrong with the registry in my system. Any
ideas?

-Yi
 
Y

Yi

Hi Shinya,

Thank you for the help. I have read the document you suggested and found it
is about issues when migrating a project. But in my case I created two
projects from 2002 and 2003 seperately. I have not yet deployed the projects
by compiling the setup project. And the one from 2003 used to work fine until
recently.

I once installed/deployed an Excel addin on the same machine where I ran and
debugged the project, I did some uninstall and install and once clicked
"Cancel" when a program installation (for this addin) window is popup because
of a deleted file that is set to be "vital" in the setup project.

For more description of my issue, see my reply to Bernd's message.

Many thanks,
-Yi
 
B

Bernd

Yi said:
Hi Bernd, the addin should be registered for both Word and Excel since when I
create the project, I selected these two applications for this addin to work
with. I checked the registry key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Excel\AddIns" and saw it has my
addin.

My addin does not contain any new method except those come with the create
project wizard, so it should not be a problem.

I found a weird thing - when I debugging the project that is created with
Visual Studio 2003, set Excel to be the "start external program", and set
breakpoint to the first line of method Connect.OnConnection() and press F5,
the cpp file containing this method that is created with Visual Studio 2003
is loaded and the debugger stoped at a breakpoint in this file!!!

I doubt there might be something wrong with the registry in my system. Any
ideas?

-Yi
Hi Yi,

the only idea I have is another trial & error one:
Please check the value of the LoadBehavior-propterty of your addins.
The value of this property is stored under registry key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Excel\AddIns\YourAddin.Connect"
Its value should be 3.

You can also check if your addins are at least loaded by Excel or Word.
Open Excel/Word and choose "COM-Add-Ins" from the "Tools"
menu.
If it is loaded but not activated, there may be a bug in your connect
method.

Sorry, no better idea for the time being.

Good luck
Bernd
 
Y

Yi

Hi Bernd, thanks a lot for the hint. I checked the loadBehavior and its value
is 3. Since my Connect methods are the original codes from the addin wizard,
I would think it is okay. I believe this is all caused by my previous manual
deleting of certain registry keys related to some addins. Since I have found
that uninstall Office and Visual Studio does not help, I will reformat the
system and see if it solves the problem.

Thanks,
Yi
 
B

Bernd

Hi Yi,

before you are going to reinstall the whole system you should try
to unregister your addin.
To do so, call regasm.exe /u <YourDllFile>

If it still doesn't work, you can manually delete all registry entries
related to your addin (use registry search).
I did this several times in the past, when I detected my addin being
loaded by word but not being activated.

Hope, my tip is not too late
Bernd
 
Y

Yi

Oh, No...I have started the formating. Thank you so much for the tips. I did
similar things before - Go to the project "Configuration Property/Build",
uncheck "Register for COM Interop". And then, manually deleting registry
entries related to my addin, including those in Excel keys. I suspect that I
might have gone too far in deleting the keys, or I may missed some (I have
created many testing projects and may missed some one of them). The
difference is that I did not use "regasm.exe".

Thank you agian for the kind help. I will post a message if something
interesting happens later.

Regards,
Yi
 
A

AlnCool

Hi,
I've made an AddIn for MS Word which is set to load when Word is lunched.
Everything works perfectly but only on my own computer (where I developped
this AddIn).
If I install my AddIn on another computer it don't work. I checked the
registry key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\AddIns" and everything is
present and the value of LoadBehavior is 3.
My AddIn uses methods to create a new ToolBox on startup with a button.

Do you have any idea why my AddIn don't work?
 
Y

Yi

If you used the setup project (created by Visual Studio) to create the msi
install package, it should be fine. If not, you should add registry keys to
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Word\Addins", besides regasm
your DLL.

If you have manually deleted some registry keys on that machine and your
addin is not working, then that is the same issue I have met and in this case
I reformatted my system.
 
A

AlnCool

Hi thank you for you answer,
it was very very quick ;)
You said "If you used the setup project (created by Visual Studio) to create
the msi
install package, it should be fine." and I did so but my AddIn don't want
to work...

I don't understand about using regasm.exe. I guess it's a tool but What is
this program used for? (is it a good sentence? Sorry my english is very
bad...)

I checked the registry on my own computer and on the computer where I tried
to install it, there is no differences ... That's why I'm wondering why my
AddIn don't work on this second one.
The only difference is it's on my own PC that I developped my AddIn with VS
2003 that's all. Both of them have the framework installed and the same OS
with MS Office 2000...
I tried many installation/uninstallation to fix it but nothing! (But I did
not remove keys myself in the registry)

Any idea?
 
A

AlnCool

Hey !
I've fix my problem :)
I have replaced my public classes to internal ones and now it works! There
is a problem with COM registration if there are public classes used within
public methods.

Hope that helps!
( ==> Thank's to Martin for his help !)
 

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