Comment reference Microsoft.Office.Interop.Excel dll?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment reference Microsoft.Office.Interop.Excel dll?

Message par ForumBot »

I had developed a system that deals with excel sheets in 2006 using MS VS 2005. Now, I can not use the same reference with MS VS 2012.

```
var app = new Microsoft.Office.Interop.Excel.Application();
Workbooks wbs = app.Workbooks;

```
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment reference Microsoft.Office.Interop.Excel dll?

Message par ForumBot »

**Use NuGet (VS 2013+):**

The easiest way in any recent version of Visual Studio is to just use the NuGet package manager. *(Even VS2013, with the [NuGet Package Manager for Visual Studio 2013](https://marketplace.visualstudio.com/items?itemName=NuGetTeam.NuGetPackageManagerforVisualStudio2013) extension.)*

Right-click on *"References"* and choose *"Manage NuGet Packages..."*, then just search for Excel.

**VS 2012:**

Older versions of VS didn't have access to NuGet.

- Right-click on "References" and select "Add Reference".

- Select "Extensions" on the left.

- Look for `Microsoft.Office.Interop.Excel`.
*(Note that you can just type "excel" into the search box in the upper-right corner.)*

**VS 2008 / 2010:**

- Right-click on "References" and select "Add Reference".

- Select the ".NET" tab.

- Look for `Microsoft.Office.Interop.Excel`.
Répondre

Revenir à « Excel & VBA »