views:

2583

answers:

4

My colleague has written a DLL which drives Excel.
When I reference his DLL in my .NET app, I get a warning:

The dependency 'Microsoft.Office.Interop.Excel' could not be found.

My app will compile.
However, when I get to the bit that uses my colleague's DLL to access Excel, an exception is thrown, with the message above.

We should have identical setups: Windows XP Pro SP3, VS2003, .NET 1.1, Office 2003

My problem seems similar to this question, but I don't know if it's the same.

Any help or suggestions gratefully received!

Update:

Thanks for answers so far!

I have not added an explicit reference to Microsoft.Office.Interop.Excel.
Surely I shouldn't have to?
However: When I tried to add this reference, I cannot find Microsoft.Office.Interop.Excel in the Add Reference dialog.

Presumably this means that I am missing a DLL?
... But I don't understand how that could happen?!

+1  A: 

Have you explicitly added a reference to Microsoft.Office.Interop.Excel in your project?

Jon Skeet
Really, nothing else we can say is of much value until this question is answered. Heh.
Robert S.
You should not add a reference to Microsoft.Office.Interop.Excel. Instead ensure the PIA's are installed (see NXC's post) and add a COM reference to the Microsoft Excel 11.0 Type Library.
Joe
PIA is certainly the right acronym for them.
FerretallicA
+2  A: 

Ask your colleague to send you the Interop.Excel.dll file that he has in his bin folder. Alternatively as Jon has suggested above you can add a reference to Microsoft Excel library from the COM tab of the Add Reference dialog.

Sijin
+2  A: 

You may need to install the Primary Interop Assemblies for Office, which can be downloaded from Here. Depending on the order that you install Visual Studio and Office they may not be installed by default.

ConcernedOfTunbridgeWells
Thanks. That fixed it!
AJ
All in a day's work ... well ... all in a day ;-}
ConcernedOfTunbridgeWells
A: 

I had the same problem trying to run the "official" F# samples on CodePlex. Projects were referencing interop V11. I removed the references and went to add them again, noticing I had V9, V12 and V14. I added V12 and everything worked fine without any further changes.

Something you might want to try before installing yet another interop version.

FerretallicA
It never ceases to amaze me why dickheads will downvote an answer without providing any kind of reason or explanation.
FerretallicA