Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello everyone, I am trying to develop a COM Add In object to run under excel 2002. I am having some problems. Thanks in advance for any help to point me in the right direction.

I am using Visual Studio 2005 Professional Edition.

To create the code I used the Visual Studio Shared Add-in Project Template and these options. Wizard Page:
1 of 5: Create an Add-in using Visual C#
2 to 5: Check Word, PowerPoint, Outlook, Excel, and Access ONLY
3 of 5: Use Default Values
4 of 5: Check the the Top box only
5 of 5: Finish

I Added project reference to System.Windows.Forms.DLL

Next I default constructor of the generated code to display a message when the COM Add-in is loaded by the Host Application:
MIDL
public Connect()
{
 try
 {
    System.Windows.Forms.MessageBox.Show( "THIS IS THE ADD IN -- CONSTRUCTOR" );
 }
 catch ( Exception ex )
 {
    System.Windows.Forms.MessageBox.Show( ex.ToString(),"Somthing Went Wrong" );
 }
}



The automated code also created a deployment setup project.

I build both projects and installed the setup project.

I check the registry to verify that keys are set correctly.

This is what I found:

HKCU\Software\Microsoft\Offic\Excel\MyComAddIn.Connect\LoadBehavior = 3

all the keys for the other offic componets were set the same as the one above.

MY OFFICE COMPONENTS ARE:
Access 2002
Excel 2002
PowerPoint 2002
Word 2002
Outlook 2003

When I ran each of the above office components this is what happened:
Access = Worked Fine
Excel = add-in did not execute; changed LoadBehavior key to 2
PowerPoint = Worked Fine
Word = add-in did not execute; changed LoadBehavior key to 2
Outlook = worked fine


I have been digging into this problem for a while and I am getting now where.

The latest Idea that I have come up with is that I think EXCEL is trying to load OLEAUT32.DLL from the \Framework\v1.1.4???? directory, but this DLL is not in the v1.1.4 framework directories.

Does anyone have any ideas ?????
Posted
Comments
Dalek Dave 1-Sep-10 17:14pm    
Reason for my vote of 5
Good Question, well laid out and fully explained.
If only they were all like this!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900