Referenced Assembly failed to load Microsoft.Office.Interop.Excel.dll

Hello,

At the opening of my GH definition, i get this error message : “Referenced Assembly failed to load Microsoft.Office.Interop.Excel.dll”.
I don’t see the problem since, on another computer, MS office versions and Rhino versions are the sames.

The definition contains VB component with code such as :
Dim objExcel As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application (...) excelSheet.Range(...).Borders.LineStyle = Microsoft.Office.Interop.Excel.XlLineStyle.xlContinuous

The DLL file is referenced on the VB component with “Manage Assemblies” command.

Any ideas ?

JLH

Probably some compatibility issue with the version of the .dll and the .NET Framework installed on your computer ?

If an assembly fails to load in a script component sometimes it’s due to missing dependencies, which is (or at least in RH5 was) displayed at the top of the source code in the script component… like next to the “using” statements. Something like “failed to load .dll” or something similar…

How can I get the .NET Framework version installed ? In Windows applications list I don’t see .NET Framework.

I am not really sure, but as far as I know Rhino 5 is .NET 4.0 and Rhino 6 .NET 4.6 (?) . And as far as I know those Office Tools for Visual Studio which include the .dll you are referencing exist also in various versions (11.0, 12.0, 14.0, 15.0), which are probably compiled for different .NET Framework versions.

So maybe the reason why the .dll doesn’t load is a compatibility issue ?!

Other reasons why the .dll fails to load could be maybe the file is not where it is supposed to be (“V:\Fiches something”) ? Or missing dependencies…

Hello,

I dit not found the direct solution to my problem!

Instead, I deleted all explicit referencse to Microsoft.Office.Interop.Excel package objects in the VB components. And so, remove the DLL reference in the VB components on “Manage Assemblies” menu item.

It works !

Thank you
JL