.NET 中的 EXCEL 自动化(COM 错误)

发布于 2024-09-24 18:33:22 字数 419 浏览 0 评论 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 项目中添加了引用“Microsoft.Office.Interop.Excel.dll”(后面是 C# 代码)。 我从下面一行收到上述错误,

Application excel = new Application();

当我安装了 ms-office 时, 它工作正常。我应该在不安装 ms-office 的情况下解决这个问题。只能通过添加dll。需要帮助。感谢副词。

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

i don't have ms-office in my system. I added the reference 'Microsoft.Office.Interop.Excel.dll' in my .net project(C# code behind). i get the above error FROM the BELOW line

Application excel = new Application();

when i have ms-office installed it works fine. i should work it out without installing ms-office. only by adding dll. help needed. Thanks in adv.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无戏配角 2024-10-01 18:33:22

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

如果未安装 Excel,则无法启动 Excel(废话)。你想做什么?

This is the problem: "i should work it out without installing ms-office"

You cannot start Excel if not Excel is not installed (duh). What are you trying to do?

缱绻入梦 2024-10-01 18:33:22

假设您想要创建或编辑 Excel 文件,我建议使用 Microsoft 的新 Open XML SDK。比 Excel Interop 工作得更好并且更容易。

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

Assuming you want to create or edit Excel Files, I recommend using the new Open XML SDK from Microsoft. Works better and is easier than Excel Interop.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文