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
If you don't have excel installed, run this command in the nuget-packet-manager-console:
Install-Package Microsoft.Office.Interop.Excel
I installed Microsoft office PIAs, but I had the same problem, cannot find microsoft.office.interop.excel dll, I also I installed Visual Studio 2010 Tools for the Office System 4.0 Runtime Service Pack 1 but still the problem persist.
Finally I resolve the problem with an add of Office / SharePoint development package to my Visual Studio 2017 installation:
Go to Tools > Get Tools and Features ..
And then check Office / sharepoint development and modify your installation.
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”.
I installed MS Office 13 and from then on I started getting this error in VS 2012 project. I tried adding the MS Office lib via COM control but that didnt work. Finally I had to add this library references from the "Extensions" section (not not under COM); had to select Microsoft.Office.Interop.Excel, version 15.0.0.0. That fixed the error.
Hope that helps some.