Interop.Excel 12.0安装问题 [英] Interop.Excel 12.0 Installation Problem

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

问题描述

我正在尝试在用户计算机上部署我的应用程序。该应用程序使用Microsoft Excel 12.0对象库作为参考。 (这是必需的。该程序使用Excel输出各种报告。)当某些用户尝试安装它时,会抛出一个错误,指出GAC中没有安装Microsoft.Office.Interop.Excel v12.0。 br />


这些用户没有在他们的机器上安装Excel 2007(或更高版本),所以我怀疑这就是问题所在。即使他们没有Excel 2007或更高版本,有没有办法在GAC中安装excel互操作v12.0?



如果答案是否定的,可以我只是在我的应用程序中使用和早期版本(如11.0)。

I am attempting to deploy my application on user machines. The application uses as a reference the Microsoft Excel 12.0 Object Library. (This is needed. The program uses Excel to output various reports.) When some of the users try to install it, an error is thrown saying that the Microsoft.Office.Interop.Excel v12.0 is not installed in the GAC.

Theses users do NOT have Excel 2007 (or later) installed on their machines, so I suspect this is where the problem lies. Is there a way the install v12.0 of the excel interop in the GAC even though they do not have Excel 2007 or later?

If the answer is no, can I just use and earlier version (like 11.0) in my application.

推荐答案

使用您的产品的先决条件是:重新分发所需版本的.NET Framework或以后,加上所需版本的Microsoft Office(可能只包括Excel及其先决条件)。



如果没有安装Office产品本身,Office Interop无法运行,但如果用户同时安装.NET和Office,则.NET可以使用相应的Office Interop程序集。它们被放置在GAC中。



当然,它会产生许可问题:您无法重新分发Office副本。您需要与Microsoft签订一些合法的许可协议,或者只是要求您的客户拥有它,作为您产品的先决条件之一。



这是其中一个我强烈反对Office开发的原因。这不是一项好的投资,可能只能在狭窄的用户群范围内接受,例如企业工具,但即便如此也是值得怀疑的。如上所述,此类产品的部署仍然很有可能,但它也会创建供应商锁定 http://en.wikipedia.org/wiki/Vendor_lock-in [ ^ ])。为什么那么麻烦?办公室有很好的替代方案。它可以像HTML一样简单。它甚至可以是.NET中的东西。例如,您可以利用WPF FlowDocument 。而且,这些天,更多的好机会。



-SA
The prerequisites for using of your product are: re-distributed .NET Framework of required version or later, plus Microsoft Office of required version (could include just the Excel and its prerequisites).

Office Interop does not work without installation of the Office product itself, but if the user installs both .NET and Offices, corresponding Office Interop assemblies become available to .NET; they are placed in GAC.

Of course, it creates the licensing problem: you cannot redistribute your copy of Office. You either need to make some legitimate license agreement with Microsoft, or simply require that your clients have it, as one of the prerequisites to your product.

This is one of the reasons why I''m strongly against Office development. This is not a good investment, maybe only acceptable in narrow user base scope, such as corporate tools, but even that is questionable. As I described above, deployment of such products is still quite possible, but it also creates the vendor lock-in (http://en.wikipedia.org/wiki/Vendor_lock-in[^]). Why having all that trouble? There are good alternatives to the Office. It can be as simple as HTML. And it can even be something within .NET. For example, you can leverage WPF FlowDocument. And, these days, a lot more good opportunities.

—SA


这是另一个想法:如果您使用Microsoft Office以外的产品,并不意味着您不能使用Office文件格式。

目前使用的格式基于XML,并在ECMA-276和ISO /下标准化IEC标准。请参阅:

http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats [< a href =http://en.wikipedia.org/wiki/Microsoft_Office_XML_formatstarget =_ blanktitle =New Window> ^ ],

http://en.wikipedia.org/wiki/Office_Open_XML [ ^ ],

http://www.ecma-international.org/publications/standards/Ecma-376.htm [ ^ ],

http://www.iso.org/iso/news.htm?refid=Ref1181 [ ^ ]。



无论如何,还可以使用与传统Microsoft Office文件一起使用的开源代码。



其中一种产品是开源和多平台LibreOffice。请参阅:

http://en.wikipedia.org/wiki/LibreOffice [< a href =http://en.wikipedia.org/wiki/LibreOfficetarget =_ blanktitle =New Window> ^ ],

http://www.libreoffice.org/ [ ^ ]。



它有SDK,允许您在应用程序中嵌入LibreOffice。重要的是,SDK for .NET也可用。请参阅:

http://api.libreoffice.org/docs/install.html [ ^ ]。



-SA
Here is another idea: if you use the product other then Microsoft Office, it does not mean that you cannot use Office file formats.
Presently use formats are based on XML and are standardized under the ECMA-276 and ISO/IEC standards. Please see:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[^],
http://en.wikipedia.org/wiki/Office_Open_XML[^],
http://www.ecma-international.org/publications/standards/Ecma-376.htm[^],
http://www.iso.org/iso/news.htm?refid=Ref1181[^].

Anyway, open-source code working with legacy Microsoft Office files is also available.

One of such products is the open-source and multi-platform LibreOffice. Please see:
http://en.wikipedia.org/wiki/LibreOffice[^],
http://www.libreoffice.org/[^].

It has SDK which allows you to embed LibreOffice in your applications. What''s important, the SDK for .NET is also available. Please see:
http://api.libreoffice.org/docs/install.html[^].

—SA


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

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