Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.Office.Interop.Excel Reference Cannot be found

Tags:

I am having troubles adding the excel reference to my project. I have already installed Primary Interop Assemblies.

The project is detecting the Microsoft.Office.Interop.Word assembly reference correctly but the excel reference still cannot be found.

When I try to manually add the reference, I right click the project, add reference, navigate to the Microsoft.Office.Interop.Excel file and try to add it manually. Once i select the reference I then make sure the reference is checked, then hit ok. Nothing happens, it fails to actually add the reference path to the project.

Using VS2012 Ultimate.

Any suggestions on what I can do to get the project to see the excel reference?

like image 999
stylex Avatar asked Oct 23 '13 13:10

stylex


2 Answers

As described in http://social.msdn.microsoft.com/Forums/vstudio/en-US/c9e83756-4ae2-4ed4-b154-1537f3bb3a22/cant-find-microsoftofficeinteropexceldll?forum=netfxsetup

  • On the Project menu, click "Add Reference."

  • On the COM tab, click Microsoft Excel Object Library, and then click Select. In Visual Studio 2012, locate Microsoft Excel 14.0 (or other version) Object Library on the COM tab.

  • Click OK in the Add References dialog box to accept your selections. If you are prompted to generate wrappers for the libraries that you selected, click “Yes”.

like image 153
SausageBuscuit Avatar answered Oct 02 '22 10:10

SausageBuscuit


If you don't have excel installed, run this command in the nuget-packet-manager-console:

Install-Package Microsoft.Office.Interop.Excel 
like image 34
Luca Ziegler Avatar answered Oct 02 '22 10:10

Luca Ziegler