Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I am attempting to compile a project but its missing the Microsoft.Office.Interop.Excel.Application reference. When going to Add References I cannot seem to find it.

If Office is installed should the reference not automatically be in the list?
How can I get it into the list?

I'm running Windows 10, VS 2015, Office 365.
Please Help.

What I have tried:

Almost Everything from re-installing to searching.
Posted
Updated 2-Aug-19 9:02am
Comments
Richard MacCutchan 2-Aug-19 7:54am    
If Office is installed on your system then the reference should be available. You can check by looking in C:\Windows\assembly to see if the libraries are there.
MadMyche 2-Aug-19 9:26am    
When Office was installed, was the optional component .NET Programmability Support installed?
Another option is to us NuGet
Benktesh Sharma 2-Aug-19 10:36am    
One area that you can check is the bit version. Check if 32bit version or 64bit of office and the corresponding version of Visual Studio match.
Dave Kreskowiak 2-Aug-19 16:23pm    
It has nothing to do with the "corresponding version" of Visual Studio. Your project compile target architecture has to match the architecture of Office. If your app is compiled targeting AnyCPU or x64 and you run it on a 64-bit machine with 32-bit Office, you're app is going to fail.
Benktesh Sharma 3-Aug-19 8:25am    
If the installed office is of 64 version and VS is 32 bit version, I am guessing you cannot refer to that office. Is that not correct? It is not about the target, but the reference to Microsoft.Office.Interop.Excel.Application. For example, SDK for 64 bit is not available when VS is 32 bit.

1 solution

You might try the repair option of Office in Control Panel as mentioned here: Interop Assemblies for Excel 2016 for c# application[^]
It could also be that you need to upgrade to VS2017, as mentioned here: Office primary interop assemblies - Visual Studio | Microsoft Docs[^]
Quote:
Starting with Visual Studio 2017, these copies of the PIAs are installed to following shared locations on the development computer
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900