类未注册(错误:80040154) [英] Class not registered (error: 80040154)

查看:177
本文介绍了类未注册(错误:80040154)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在网上搜索,试图找到解决这个问题的方法。此错误仅来自少数计算机。我不确定为什么这会在一小部分电脑中展出而其他人却没有遇到这个问题。



这是问题所在。我有一个应用程序将数据写入excel 2010文件。程序放置图形,对于某些单元格,它会将数据与标题信息(生成此文档的人员以及何时生成)放在一起。正如我之前提到的,这适用于许多(几乎所有)计算机,并且正如预期的那样。但是,有很少的计算机只能通过程序将图形粘贴到excel文档中,但是当将文本写入单元格时会弹出这个错误...用CLSID blah检索组件的COM类工厂由于以下错误导致blah失败:80040154类未注册。



我的第一个初步反应是计算机没有安装Excel 2010,这是一个先决条件应用。检查后确实有它。所以在网上搜索我发现了一些建议如下的文章。



Excel未正确安装。 [ ^ ]

MSDN:FM20.dll需要重新启动已注册 [ ^ ]

确保将目标版本设置为x86 [ ^ ]



我已确认程序在以下代码行中失败。

I have been searching all over the net trying to find to the solution to this problem. This error only comes up from a few machines. I am uncertain as to why this gets exhibited in a minor set of computers and others don't get this problem.

Here is the problem. I have an application that writes data to an excel 2010 file. The program puts graphs, and for some cells it puts in data along with the header information (who generated this document and when). As I mentioned previously this works on many (almost all) computers just fine and as expected. However, there are a very few computers that will only get the graphs pasted into the excel document via the program, but when it comes to writing text into the cells this error pops up... Retrieving the COM class factory for component with CLSID blah blah failed due to the following error: 80040154 Class not registered.

My first initial reaction was that the computers did not have Excel 2010 not installed which is a prerequiste for the application. Upon checking they do have it. So searching the net I found a few articles that suggest the following.

Excel was not properly installed.[^]
MSDN: FM20.dll needs to be re-registered[^]
Make sure the Target build is set to x86[^]

I have confirmed that the program fails at the following line of code.

ExcelWriter = New ExcelInterfaceDLL.clsExcelInterface
ExcelWriter.ExcelSheet = ExcelSheet



我不知道下一步该做什么。我的程序是桌面独立的VB.NET应用程序,在Excel中生成报告。大多数计算机运行得很好,除了这几个。它只能在x86上运行,因为有第三方工具只需要x86。



任何人都可以提出下一步我可以尝试的建议吗?我是否忽视了一些非常明显的事情(我真的希望如此)?



非常感谢任何建议。


I am at a loss of what to do next. My program is desktop stand alone VB.NET app the generates reports in Excel. Most computers run just fine except for these few. It can only run on x86 as there are 3rd party tools that require x86 only.

Can anyone offer any suggestions as to what I could try next? Did I overlook something incredibly obvious (I really do hope so)?

Would greatly appreciate any advice.

推荐答案

尝试使用以下免费组件,而不是使用office iterop: https://epplus.codeplex.com/ [ ^ ]
Try using a free component like the following instead of using the office iterop : https://epplus.codeplex.com/[^]


这是对问题。实际上,我找到了答案。我没有意识到有一个32位注册表和一个64位注册表。我在这篇文章中找到了问题的答案 http://stackoverflow.com/questions/9711079/class-not-registered-error-for-instantiation-of-c-sharp-object-via-com-from-vc [ ^ ]



一旦我查看了64位注册表,我发现安装中缺少一个DLL从一些电脑。当我在有问题的计算机上注册丢失的DLL时,问题就消失了。



我希望这可以帮助遇到这个奇怪错误的人。
Here is an update to the issue. Actually, the answer that I found. I didn't realize that there was a 32-bit registry and a 64-bit registry. I found the answer to the problem from this post http://stackoverflow.com/questions/9711079/class-not-registered-error-for-instantiation-of-c-sharp-object-via-com-from-vc[^]

Once I looked in the 64-bit registry I found out that there was a DLL missing from the installation from some computers. When I registered the missing DLL on the computer that had the issue the problem just disappeared.

I hope that this may help someone who comes across this strange error.


这篇关于类未注册(错误:80040154)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆