简体   繁体   中英

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:

Microsoft Excel 15.0 Object Library

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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