简体   繁体   English

添加Microsoft.Office.Interop.Excel参考

[英]adding Microsoft.Office.Interop.Excel reference

I am attempting to write ac# script that performs work on an excel spreadsheet. 我正在尝试编写在Excel电子表格上执行工作的ac#脚本。 (Rather then a VBA macro). (而不是VBA宏)。 I am trying to add the reference to the Microsoft.Office.Interop.Excel assembly. 我试图将引用添加到Microsoft.Office.Interop.Excel程序集。 I cannot find any reference to said assembly in the Add Reference... Window or by browsing to C:\\Windows\\assembly\\GAC . 我在“添加引用...”窗口中或通过浏览到C:\\Windows\\assembly\\GAC都找不到对所述程序集的任何引用。 It does not exist. 它不存在。 I uninstalled and reinstalled office, and I also downloaded and installed the PIA redistributable located here . 我卸载并重新安装了Office,还下载并安装了位于此处的PIA可再发行组件。 The Microsoft.Office.Core is the closest assembly I found, added via COM -> Microsoft Office 14 / 15 Object Library. Microsoft.Office.Core是我找到的最接近的程序集,是通过COM-> Microsoft Office 14/15对象库添加的。 Any comments or advice appreciated. 任何意见或建议表示赞赏。

I see a copy under C:\\Windows\\assembly\\GAC_MSIL. 我在C:\\ Windows \\ assembly \\ GAC_MSIL下看到一个副本。 Is it there for you? 有给你吗?

If that doesn't work, open Windows Command Processor and use 如果这样不起作用,请打开Windows命令处理器并使用

dir /s microsoft.office.interop.excel.*

In my C# project, the path is 在我的C#项目中,路径为

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

I am using Excel 2010 我正在使用Excel 2010

You might want to have a look at a related post . 您可能想看一下相关的帖子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM