【问题标题】:Silverlight error - While creating Workbook object of interope excelSilverlight 错误 - 创建互操作 Excel 的工作簿对象时
【发布时间】:2012-10-16 08:44:51
【问题描述】:

当我使用来自域服务的下一行创建时出现以下错误。

Microsoft.Office.Interop.Excel.Workbook excel = new Microsoft.Office.Interop.Excel.Workbook();


---------------------------
Error
---------------------------
Invoke operation 'CallExcel' failed. Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
---------------------------
OK   
---------------------------

这个奇怪的错误的原因是什么?如果我使用 word 对象,那么它也适用于互操作。

【问题讨论】:

  • 您是从浏览器中运行的 Silverlight 代码还是从服务器调用此代码?您确定最终用户已安装 Office 且版本正确吗?
  • Silverlight 没有 Interop 接口,但 AutomationFactory 有 dynamic 对象。所以,这是一个服务器端代码:)
  • 我还有一个问题,当我使用 WCF 运行/打开 word 文档模板文件时,它工作正常。 (注:word 模板文件由宏组成)。但是当我打开任何包含宏(带有对话框选择的宏)的word文件时。 Silverlight 页面挂起,因为 WCF 服务在服务器端打开了该宏对话框。如果我在本地运行应用程序,则可以正常工作,并且还会在本地环境中打开宏对话框。我可以为此做些什么??

标签: asp.net wcf silverlight silverlight-4.0 wcf-ria-services


【解决方案1】:

你应该创建 excel 应用程序。第一的。 MSDN

【讨论】:

  • 是的,谢谢 - 我也是这么想的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多