What link do I need to use Microsoft.Office.Interop.Excel in .NET?

I am interested in using C # to manage / Automate Excel files.

After browsing the web, I found VSTO , but it seems you cannot use this in Visual Studio Express Edition, so I cannot use this.

Just a few minutes ago, I noticed a question on this site that used this namespace in its code:

Microsoft.Office.Interop.Excel

So, I wonder if all I need to use is to add the necessary link, and if so, which link to add?

UPDATE

I set Primary Interop Assemblies as the accepted answer, but for some reason they are still missing from the Add Link dialog box in the .NET section, but they are present in the GAC.

So, I just added the link using Browse and located Microsoft.Office.Interop.Excel.dll in the GAC folder.

But when looking for similar questions on this site regarding adding links from the GAC, it seems like this is not recommended.

+82
c # office-interop visual-studio-express
May 7 '12 at 7:00
source share
14 answers

Update (thanks user2347528)

These assemblies are available as NuGet packages, which is much simpler than my original answer.

You can install either by right-clicking on Links in your project, selecting Manage NuGet Packages ... and search for one of the packages listed below or install using the package manager console:

 PM> Install-Package Microsoft.Office.Interop.Excel 



They are available as β€œPrimary Interop Assemblies,” which can be installed in Office or downloaded and installed separately. A practical guide. Install primary Office collections .

Once they are installed, you can link to them in your project in the Add Link dialog box in the .NET section. If you do not see the listed Microsoft.Office.Interop assemblies, they are not installed yet. Install them from your installation or download and install them separately (see My download link above).

+73
May 7 '12 at 7:03 a.m.
source share

It was just this problem itself, and the accepted answer did not help me, but I decided:

Add reference > Browse > C: > Windows > assembly > GAC > Microsoft.Office.Interop.Excel > 12.0.0.0_etc > Microsoft.Office.Interop.Excel.dll

+45
Mar 14 '13 at 14:25
source share

The answers did not help me solve my problem, I could not find (and view) the assemblies, although I installed them using the Microsoft msi installer. For me, the excel compilation is located under C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll

+23
Jul 24 '14 at 6:37
source share

Just add the link Microsoft.Office.Interop.Excel .

It includes classes related to MicroSoft Excel, no need to add sitelinks.

+8
May 7 '12 at 7:06 AM
source share

I assume that you are trying to add Microsoft.Office.Interop.Excel with a using statement without adding a link to your application, in which case it cannot be found. Before invoking the using statement, you need to add a link to the ur application. Right-click on References and add the Excel Interop link.

+3
May 7 '12 at 8:24 AM
source share

Add Link> Browse> C:> Windows> Build> GAC> Microsoft.Office.Interop.Excel> 12.0.0.0_wasd ..> Microsoft.Office.Interop.Excel.dll

+3
May 05 '13 at 11:38
source share

it in a lumpy component called: "Microsoft Office 14 Object Library"

+3
Apr 07 '14 at 16:40
source share

Best option since Office 2007 uses the Open XML SDK for it. We used Word.Interop, but sometimes it stopped, and Microsoft does not recommend using it as a document formatting on the server side, so the Open XML SDK makes it easy to create text documents in DOCX and Open XML formats. This allows you to cope well with scalability, confidence (files, if they are damaged, can be restored), as well as other very subtle characteristics.

+3
Feb 05 '16 at 8:19
source share

If you have Microsoft Office installed, you can add a link to Interop.Excel.

For example, the computer on which I am printing this has MSVS 2010 C # Express and Office 2010. I can add a link to Microsoft.Office.Interop.Excel 11.0.0.0.

'Hope that helps

+2
May 7 '12 at 7:05
source share

I had the same problem, but none of these answers helped me. I found the dll on my computer in the place where Mosty noted: ( C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll ), but it is not the one that was specified in the project that I was trying to create.

The link in our project in Visual Studio 2012 pointed to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\ . This place was empty for me, but it worked great for everyone else. It took several attempts, but I finally tracked down the working installer. Hope this saves others from the same problems!

β†’ Office suite installation utility for VS2012 <-

This was located on the Office Documentation and Download page. Scroll down to Download Tools . There is also one for VS2013.

+2
Nov 13 '14 at 21:27
source share

I found it in the Assemblies-> Extensions section in VS2013.

Add reference

+2
Jan 05 '15 at 14:46
source share

Here is a super solid solution, you just need to have excell.dll in the Debug / Release Mine folder - 77,824 bytes, I downloaded it as a file, this also explains why some people compiled Debug, but Release not or vice versa.

Trento

+1
Oct 30
source share

1.Download and install: Microsoft Office Development Tools

2. Add links from:

C: \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Visual Studio Tools for Office \ PIA \ Office15

+1
Jul 24 '15 at 15:25
source share

I had the same problem and Microsoft.Office.Interop did not appear in the Add Link option after upgrading VS2012 to VS2015. I basically repaired the installation (Control Panel> Programs and Features> VS 2012> Right-click Change> Restore) and added the Microsoft Office component. After that, the same decision began.

+1
Nov 03 '15 at 0:01
source share



All Articles