Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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.
VB
ExcelWriter = New ExcelInterfaceDLL.clsExcelInterface
ExcelWriter.ExcelSheet = ExcelSheet

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.
Posted

Try using a free component like the following instead of using the office iterop : https://epplus.codeplex.com/[^]
 
Share this answer
 
Comments
Clark Kent123 23-Aug-13 13:57pm    
Thank your response. Sadly, at this stage I don't think I will be able to transition to another component. But never the less I appreciate your comment have bookmarked that link. Thanks!

For the time being I am going to put this problem on hold and step away from it for brief period of time. I have spent almost 2 days trying to figure out why such a few computers exhibit this problem. I still believe the solution is quite obvious.
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900