在服务器上安装没有 Office 的 Office Interops
我正在使用 Excel Interop 更改 Excel 单元格。
我尝试过许多开源解决方案,但文件在读取时已损坏。因此,我坚持使用 Excel Interop。
在服务器上开发时,我遇到了这个问题:
Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
因此,我想在我的服务器上安装 Office interop: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id =18346
但是,当我安装它时,我遇到了这个问题:
“请在安装此产品之前安装 Microsoft Office 2007”
我的问题是:是否可以在服务器上安装没有 Office 2007 的互操作程序?
提前致谢。
I am working with changing excel cells using Excel Interop.
I have tried with many open source solutions but the file is corrupted while reading. Therefore, I am stick on using Excel Interop.
When developing on the server, I got this problem:
Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Therefore, I would like to install Office interop on my server: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18346
However, when I install it, I got this problem:
"Please install Microsoft Office 2007 before installing this product"
My question is: would it be possible to install the interop without the office 2007 on the server?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是不可能的。 Office Interop 只是访问 (COM) Office 组件的 .NET 方式。因此它们必须在那里,否则 Office Interop 就没有理由在那里。
如果您想开发读/写 Office 文件的应用程序,您可以使用 OpenXML(另请参阅 http://en.wikipedia.org/ wiki/Office_Open_XML)和非官方的 ClosedXML (http://linedxml.codeplex.com/) 或第三方组件,例如 SmartXLS (http://www.smartxls.com/)。
No, this is not possible. Office Interop is only a .NET means to access the (COM) Office components. So they have to be there, or the Office Interop has no reason to be there.
If you want to develop applications that read/write Office files, you may use OpenXML (see also http://en.wikipedia.org/wiki/Office_Open_XML) and the unofficial ClosedXML (http://closedxml.codeplex.com/) or third-party components such as SmartXLS (http://www.smartxls.com/).