[英]How to import Microsoft.Office.Interop.Excel on a console application?
It works fine on my Website Application, but I have to use it too on console application that will run from the task scheduler. 它在我的网站应用程序上工作正常,但我也必须在将从任务调度程序运行的控制台应用程序上使用它。
This is how I'm calling the import: 这就是我调用导入的方式:
Imports Excel = Microsoft.Office.Interop.Excel
Problem is when I try to import it from the console app, I get this error: 问题是当我尝试从控制台应用程序导入它时,我收到此错误:
Namespace or type specified in the Imports 'Microsoft.Office.Interop.Excel' doesn't contain any public member or cannot be found
Any ideas on how to solve this? 关于如何解决这个问题的任何想法? Thanks.
谢谢。
您应该Add Reference
对Microsoft.Office.Interop.Excel
组件的Add Reference
with Visual Studio 2013 the answer to this question is to add reference: 使用Visual Studio 2013,这个问题的答案是添加引用:
Microsoft Excel 15.0 Object Library Microsoft Excel 15.0对象库
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.