简体   繁体   English

WinForm应用程序和MS Office参考

[英]WinForm application and MS Office references

In our WinForms project, we need to give a facility to import data from Excel sheets. 在我们的WinForms项目中,我们需要提供一种从Excel工作表导入数据的功能。

There are ways to refer MS Office files (here Office 2003) in your project references. 在项目引用中有多种方法可以引用MS Office文件(此处为Office 2003)。

Each time there is slight difference in build environment the project reference breaks and shows an Excel missing error. 每次构建环境稍有不同时,项目引用就会中断并显示Excel缺失错误。

My question is How to correctly refer Office 2003 files into your WinForm Application? 我的问题是如何正确地将Office 2003文件引用到WinForm应用程序中?

This is a big issue with Office, we had it too (Office 2003 vs. Office 2007) 这是Office的一个大问题,我们也遇到过(Office 2003与Office 2007)

We had two solutions: 我们有两种解决方案:

  • Created a gateway library that was precompilled and referenced that instead of the real Excel dll. 创建一个预编译并引用了它的网关库,而不是真正的Excel dll。

  • Used an external Excel library like ExcelReader . 使用了像ExcelReader这样的外部Excel库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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