2

I am attempting to write a c# script that performs work on an excel spreadsheet. (Rather then a VBA macro). I am trying to add the reference to the Microsoft.Office.Interop.Excel assembly. I cannot find any reference to said assembly in the Add Reference... Window or by browsing to C:\Windows\assembly\GAC. It does not exist. I uninstalled and reinstalled office, and I also downloaded and installed the PIA redistributable located here. The Microsoft.Office.Core is the closest assembly I found, added via COM -> Microsoft Office 14 / 15 Object Library. Any comments or advice appreciated.

andrsnn
  • 1,591
  • 5
  • 25
  • 43

2 Answers2

1

I see a copy under C:\Windows\assembly\GAC_MSIL. Is it there for you?

If that doesn't work, open Windows Command Processor and use

dir /s microsoft.office.interop.excel.*
jlee-tessik
  • 1,510
  • 12
  • 16
1

In my C# project, the path is

C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll

I am using Excel 2010

You might want to have a look at a related post.

Community
  • 1
  • 1
Axel Kemper
  • 10,544
  • 2
  • 31
  • 54
  • this works. I did see that post, now I see several of the answers BELOW the ones I was attempting were correct. I was following `Add reference > Browse > C: > Windows > assembly > GAC > Microsoft.Office.Interop.Excel > 12.0.0.0_etc > Microsoft.Office.Interop.Excel.dll` – andrsnn Feb 04 '15 at 22:57