3

我正在 Window 7 中使用 C#.NET 开发应用程序。该应用程序生成 excel 文档。在我的系统中,已经安装了 Office 2010。

由于以下错误,从 IClassFactory 创建 CLSID 为 {00024500-0000-0000-C000-000000000046} 的 COM 组件实例失败:80010001。

4

2 回答 2

3

你没有提供太多关于的信息。它是 Web、Windows 服务还是桌面应用程序?

但是,不再需要使用 com interop 来以新的基于 xml 的格式创建 Excel 文件。看到这个:

http://excelpackage.codeplex.com/

此致。

于 2012-09-13T09:54:02.017 回答
2

As Oscar have said, using Interop classes is not required for excel-file generation. Even Microsoft says you should not be doing that. There are other packages that can create xls or xlsx files for you. I have used NPOI in the past and was very happy with it.

27 Oct 2015 Update: NPOI has a is horrible API. Use OpenXml-based EPPlus - much more comfortable to work with and gives you a lot better code comparing to NPOI when producing the same documents.

于 2012-09-13T10:08:11.783 回答