简体   繁体   English

如何在控制台应用程序上导入Microsoft.Office.Interop.Excel?

[英]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 ReferenceMicrosoft.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.

相关问题 升级到Office 2016参考错误:Microsoft.Office.Interop.Excel - Upgrading to Office 2016 Reference Error: Microsoft.Office.Interop.Excel Excel到DataTable? 不使用Microsoft.Office.Interop.Excel - Excel to DataTable? Without using Microsoft.Office.Interop.Excel 使用 Microsoft.Office.Interop.Excel 而实际上没有 Excel? - Using Microsoft.Office.Interop.Excel without actually having Excel? 我收到错误“应用程序”在命名空间“microsoft.office.interop.excel”中不明确 - I'm getting the error “Application” is ambiguous in the namespace 'microsoft.office.interop.excel' Microsoft.Office.Interop.Excel - 如何将 Excel(仅可见单元格)保存到 Z1423DE713A2E4D3B38D7 中的 CSV - Microsoft.Office.Interop.Excel - How to save Excel (Visible cells only) to CSV in vb.net microsoft.office.interop.excel保留在进程列表中 - microsoft.office.interop.excel stays in Process list 如何以编程方式检查Microsoft.Office.Interop.Excel是否可用于VB? - How can I check programmatically if Microsoft.Office.Interop.Excel is available for use with VB? Microsoft.Office.Interop.Excel VB.NET如何禁用工作表中的选择锁定值 - Microsoft.Office.Interop.Excel VB.NET How to disable select locked values in a worksheet 如何使用Microsoft.Office.Interop.Excel在SSIS 2013中找到VB.Net的正确语法? - How do I find the right syntax for VB.Net in SSIS 2013 using Microsoft.Office.Interop.Excel? 使用Microsoft.Office.Interop.Excel在文本文件中处理Excel错误的日期 - Excel bug handling dates in Text files using Microsoft.Office.Interop.Excel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM