如何为programmi Office Excel / Word添加互操作引用

时间:2016-03-05 13:03:29

标签: c# vsto office-interop

在寻找这个问题的解决方案后,我找不到一个有效的解决方案。我想用Visual Studio在excel上进行编程,我在我的机器上安装了Office 2010,并在安装运行时检查了所有功能。我在Visual Studio中创建了一个项目,并添加了对Office 14对象库的引用

enter image description here

enter image description here

然后我尝试使用Interop库在我的班级中定义但是......

enter image description here

...我无法找到Interop !!!为什么呢?

1 个答案:

答案 0 :(得分:0)

这是因为Microsoft Excel和Word界面位于

Microsoft.Office.Interop.Excel

Microsoft.Office.Interop.Word

分别命名空间。 相反,添加这些引用,它应该工作。