我正在尝试在一台没有安装 Office 的服务器上运行我的应用程序。
using EXCEL = Microsoft.Office.Interop.Excel;
...
EXCEL.Application app = new EXCEL.Application();//Exception thrown here
代码在我的系统上运行良好,但在服务器上却出现以下异常:
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位的,我已经将Excel Interop dll复制到应用程序的exe旁边。我还安装了O2010PIA。
有任何线索吗?