Click here to Skip to main content
15,919,121 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am facing the same issue with excel generation on windows server 2010. DO we have solution for this. I have even implemented IMessagefilter but it didn't work. Please can some help to resolve this issue?

Thanks in advance

Creating an instance of the COM component with CLSID {00024500-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 8001010a.

What I have tried:

added thread.sleep and tried to convert windows service from mta to sta but the issue still exists. Please let me know how to check if it a server configuration issue.
Updated 3-Jul-17 3:38am

The problem is that you're using an Office application in a non-user-interactive environment. You can NOT use Office Interop in web applications or window services. If there isn't a user logged into the console and using your application, Office Interop cannot be used.

The problem is that Office applications do not support re-entrancy. That means it cannot handle multiple requests at the same time.
Share this answer
Member 13290370 3-Jul-17 10:13am    
Yes, the excel automation perfectly works in Production environment. We are working on implementing new changes and deploying the code on test server, we are facing this issue. Is this due to server configuration?
Dave Kreskowiak 3-Jul-17 10:52am    
Ummm...perhaps you didn't read my post. YOU CAN'T DO THAT. Sure, it may work now, but this is the problem you run into with using Office Interop in a web application. It can and will STOP WORKING at any time.

This is not a server configuration issue. This is a "rewrite the code" problem to remove all dependencies on Office applications. Depending on what your doing with it, you can probably get away with using the OpenXML SDK or the ClosedXML SDK to do your Excel work.
Dave Kreskowiak 3-Jul-17 11:00am    
Read this[^].
Richard Deeming 4-Jul-17 12:08pm    
Use a library that doesn't rely on automating Excel. For example:

* EPPlus[^];
* ClosedXML[^];
* The OpenXML SDK[^];
Member 13290370 6-Jul-17 5:12am    
As suggested by Richard I am using EPPLUS. But can u tell me how to access excel vba macro in c# using EPPLUS? OR tell me what are all the other ways to access vba macros in c#. Basically I want to get the macro vba method input parameters as per the given method name. I have used Microsoft.vbe.interop(VBIDE) to access vba components but getting 8001010a ICLASSFACTORY COM errors.
COM is sometimes weired and you must stick to the error message. My best guess is that you have another instance running as descibed here from a MVP or some issues with Norton virus scanner.

Take a look in your task manager to ensure that no other Excel instance is running.

Why arent you doing it in this manner?
Share this answer
Member 13290370 3-Jul-17 10:11am    
Even I have tried Marshal.ReleaseComObject(workBook) as well but these also didn't help. Finally created Killexcepprocess method and killing the excels if any excel process is stuck due to failure in generating the report.
As per the error, I agree that the error is saying excel is busy. But my Question is
why it is busy?, and how can i know what is running in the back
ground?. the thing is in my production computer the application works
perfect. i am thinking it is an issue of some kind of configuration in
server (office excel or firewall or antivirus softwares) a
please any suggestion is appreciated

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