<legend id='cSgJy'><style id='cSgJy'><dir id='cSgJy'><q id='cSgJy'></q></dir></style></legend><tfoot id='cSgJy'></tfoot>

        <bdo id='cSgJy'></bdo><ul id='cSgJy'></ul>

      <i id='cSgJy'><tr id='cSgJy'><dt id='cSgJy'><q id='cSgJy'><span id='cSgJy'><b id='cSgJy'><form id='cSgJy'><ins id='cSgJy'></ins><ul id='cSgJy'></ul><sub id='cSgJy'></sub></form><legend id='cSgJy'></legend><bdo id='cSgJy'><pre id='cSgJy'><center id='cSgJy'></center></pre></bdo></b><th id='cSgJy'></th></span></q></dt></tr></i><div id='cSgJy'><tfoot id='cSgJy'></tfoot><dl id='cSgJy'><fieldset id='cSgJy'></fieldset></dl></div>

      1. <small id='cSgJy'></small><noframes id='cSgJy'>

        创建 Excel 应用程序时出现 COM 异常 80040154

        COM Exception 80040154 When creating an Excel Application(创建 Excel 应用程序时出现 COM 异常 80040154)
        <i id='Z6YD5'><tr id='Z6YD5'><dt id='Z6YD5'><q id='Z6YD5'><span id='Z6YD5'><b id='Z6YD5'><form id='Z6YD5'><ins id='Z6YD5'></ins><ul id='Z6YD5'></ul><sub id='Z6YD5'></sub></form><legend id='Z6YD5'></legend><bdo id='Z6YD5'><pre id='Z6YD5'><center id='Z6YD5'></center></pre></bdo></b><th id='Z6YD5'></th></span></q></dt></tr></i><div id='Z6YD5'><tfoot id='Z6YD5'></tfoot><dl id='Z6YD5'><fieldset id='Z6YD5'></fieldset></dl></div>
      2. <legend id='Z6YD5'><style id='Z6YD5'><dir id='Z6YD5'><q id='Z6YD5'></q></dir></style></legend>

            <tbody id='Z6YD5'></tbody>
          • <bdo id='Z6YD5'></bdo><ul id='Z6YD5'></ul>
          • <small id='Z6YD5'></small><noframes id='Z6YD5'>

                <tfoot id='Z6YD5'></tfoot>
                1. 本文介绍了创建 Excel 应用程序时出现 COM 异常 80040154的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在没有也不会安装 Office 的服务器上运行我的应用程序.

                  I'm trying to run my application on a server which does not and will not have Office installed on it.

                  using EXCEL = Microsoft.Office.Interop.Excel;
                  ...
                  EXCEL.Application app = new EXCEL.Application();//Exception thrown here
                  

                  代码在我自己的系统上运行良好,但在服务器上却出现以下异常:

                  The code is working fine on my own system, but on the server it gives the following exception:

                  Unhandled Exception: System.Runtime.InteropServices.COMException: 
                  Retrieving the COM class factory for component with CLSID {...} failed
                  due to the following error: 80040154 Class not registered
                  (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
                  

                  两个系统都是 32 位的,我复制了应用程序 exe 旁边的 excel Interop dll.我还安装了 O2010PIA.

                  both systems are 32bits, and I've copied the excel Interop dll next to application's exe. I've also installed O2010PIA.

                  有什么线索吗?

                  推荐答案

                  Office 互操作程序集是运行时可调用的包装器 (RCW),它允许您通过它的 COM API 与安装在系统上的 Office 副本进行互操作暴露.

                  The Office Interop assemblies are runtime-callable wrappers (RCW) that allow you to interoperate with a copy of Office that's installed on the system via the COM API that it exposes.

                  错误消息表明没有安装 Excel,这正是我所期望的.不能在没有 Office 的计算机上使用 Interop 程序集.

                  The error message indicates that Excel isn't installed, exactly what I'd expect. You can't use the Interop assemblies on a machine without Office.

                  这篇关于创建 Excel 应用程序时出现 COM 异常 80040154的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  C# Attributes and their uses(C# 属性及其用途)
                  C# - Getting all enums value by attribute(C# - 按属性获取所有枚举值)
                  <i id='D2p51'><tr id='D2p51'><dt id='D2p51'><q id='D2p51'><span id='D2p51'><b id='D2p51'><form id='D2p51'><ins id='D2p51'></ins><ul id='D2p51'></ul><sub id='D2p51'></sub></form><legend id='D2p51'></legend><bdo id='D2p51'><pre id='D2p51'><center id='D2p51'></center></pre></bdo></b><th id='D2p51'></th></span></q></dt></tr></i><div id='D2p51'><tfoot id='D2p51'></tfoot><dl id='D2p51'><fieldset id='D2p51'></fieldset></dl></div>
                    <tbody id='D2p51'></tbody>
                          <bdo id='D2p51'></bdo><ul id='D2p51'></ul>
                          <legend id='D2p51'><style id='D2p51'><dir id='D2p51'><q id='D2p51'></q></dir></style></legend>
                        • <tfoot id='D2p51'></tfoot>

                            <small id='D2p51'></small><noframes id='D2p51'>