0
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154.

我的系统中没有 ms-office。我在我的 .net 项目(后面的 C# 代码)中添加了引用“Microsoft.Office.Interop.Excel.dll”。我从 BELOW 行得到上述错误

Application excel = new Application();

当我安装了 ms-office 时,它​​工作正常。我应该在不安装 ms-office 的情况下解决它。只能通过添加dll。需要帮助。谢谢你的建议。

4

2 回答 2

4

这就是问题所在:“我应该在不安装 ms-office 的情况下解决它”

如果没有安装 Excel,您将无法启动 Excel (duh)。你想做什么?

于 2010-09-23T10:24:53.190 回答
1

假设您要创建或编辑 Excel 文件,我建议使用 Microsoft 的新 Open XML SDK。比 Excel 互操作更好,更容易。

http://blogs.msdn.com/b/excel/archive/2008/11/25/using-the-open-xml-sdk-to-work-with-excel-files.aspx

于 2010-09-23T10:27:52.490 回答