如何在控制台应用程序上导入Microsoft.Office.Interop.Excel?(How to import Microsoft.Office.Interop.Excel on a conso

系统教程 行业动态 更新时间:2024-06-14 17:01:34
如何在控制台应用程序上导入Microsoft.Office.Interop.Excel?(How to import Microsoft.Office.Interop.Excel on a console application?)

它可以在我的网站应用程序上正常工作,但是我也必须在将从任务计划程序运行的控制台应用程序上使用它。

这就是我称之为导入的方式:

Imports Excel = Microsoft.Office.Interop.Excel

问题是当我尝试从控制台应用程序导入它时,出现此错误:

Namespace or type specified in the Imports 'Microsoft.Office.Interop.Excel' doesn't contain any public member or cannot be found

有关如何解决这个问题的任何想法? 谢谢。

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组件

You should Add Reference to Microsoft.Office.Interop.Excel component

更多推荐

本文发布于:2023-04-20 18:48:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/88f152b3d4fb5a3bbfe642af1ebf3cbe.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   应用程序   如何在   Microsoft   Office

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!