在服务器上安装没有 Office 的 Office Interops

发布于 2025-01-03 14:00:01 字数 695 浏览 0 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

困倦 2025-01-10 14:00:01

不,这是不可能的。 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/).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文