Hi,
I am currently having a problem with 2 excel add-ins built with NetOffice version 1.6 and 1.7.2. These two add-ins are being developed on the same machine The second add-in that loads (loading seems to be based on the addin progid, and then in alphabetical order) will throw an exception in the __IDTExtensibility2.OnConnection__ method. The method looks like this:
```
void IDTExtensibility2.OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
try
{
this.excelApplication = new Excel.Application(null, application);
...do some work...
}
catch (Exception exception)
{
...
}
}
```
The exception is thrown where the new '''Excel.Application''' is being created. The message of the exception is the following:
_Object reference not set to an instance of an object._
Does anybody have an idea what may be the cause of this problem? Could the problem be that the two add-ins do not use the same version? one is using version 1.6, the other is using version 1.7.2.
Comments: ** Comment from web user: samgerene **
I am currently having a problem with 2 excel add-ins built with NetOffice version 1.6 and 1.7.2. These two add-ins are being developed on the same machine The second add-in that loads (loading seems to be based on the addin progid, and then in alphabetical order) will throw an exception in the __IDTExtensibility2.OnConnection__ method. The method looks like this:
```
void IDTExtensibility2.OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
try
{
this.excelApplication = new Excel.Application(null, application);
...do some work...
}
catch (Exception exception)
{
...
}
}
```
The exception is thrown where the new '''Excel.Application''' is being created. The message of the exception is the following:
_Object reference not set to an instance of an object._
Does anybody have an idea what may be the cause of this problem? Could the problem be that the two add-ins do not use the same version? one is using version 1.6, the other is using version 1.7.2.
Comments: ** Comment from web user: samgerene **
I can confirm that the problem is indeed due to a version conflict. I just updated the addin that was referencing NetOffice version 1.6.0.0 to 1.7.2 and the problem is gone. Is there a way to handle this without the requirement that all NetOffice based add-ins must use the same version of NetOffice? Add-in developers do not have control over all add-ins that may be installed by users, which may be referencing different versions of NetOffice, only the first add-in that gets loaded (and the order seems to be determined by the name of the addin) is the only one that will work.