.NET 中的 EXCEL 自动化(COM 错误)
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是问题所在:“我应该在不安装 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?
假设您想要创建或编辑 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