关于Microsoft.Office.Interop.Excel.dll问题 [英] Regarding Microsoft.Office.Interop.Excel.dll issue

查看:215
本文介绍了关于Microsoft.Office.Interop.Excel.dll问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



在我的应用程序中,我在我的Windows应用程序中创建了excel对象并生成了xls报告。



 Microsoft.Office.Interop.Excel.Application objxlApp = 
new Microsoft.Office.Interop.Excel。应用();





我在应用程序中添加了引用。

我在WinServer2012R2中运行应用程序。



错误

无法加载文件或程序集'office,Version = 11.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c'或其依赖项之一。系统找不到指定的文件。





请告诉我是否必须在服务器机器上安装excel才能运行应用程序。



谢谢

解决方案

如果您使用Office Interop,那么您必须安装Office在服务器上。



如果您是从非交互式程序生成电子表格,那么您还应该阅读以下Microsoft知识库文章:

< blockquote class =quote>



微软没有目前建议并且不支持从任何无人参与的非交互式客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT服务)自动化Microsoft Office应用程序,因为Office可能会出现不稳定的行为和/或死锁时Office在此环境中运行。



有多种方法可以在服务器上创建Excel电子表格而无需安装Excel。例如:


Hi all

In my application i have created excel object in my windows application and generating xls report.

Microsoft.Office.Interop.Excel.Application objxlApp =
                     new Microsoft.Office.Interop.Excel.Application();



I added the reference in application.
and i am running the application in WinServer2012R2.

error

Could not load file or assembly 'office, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.



Please let me know is it mandatory to have excel installed in the server machine in order to run the application.

Thank you

解决方案

If you use Office Interop, then you must have Office installed on the server.

If you're generating the spreadsheet from a non-interactive program, then you should also read the following Microsoft knowledgebase article:


Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.


There are various ways to create Excel spreadsheets on the server without having Excel installed. For example:


这篇关于关于Microsoft.Office.Interop.Excel.dll问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆