I have a C# console application and it is creating excel file and send mail to our customer.
It's working in test server but its not working in production server and we get this following error ;
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
I did not find any solution for this error.
We're creating excel file like this and this code fire an error ;
_appExcel = new Microsoft.Office.Interop.Excel.Application();
Anyone help me about this situation ? Thanks !
I'm using https://www.npmjs.com/package/node-msoffice-pdf to convert a word to a pdf. This solution works perfectly on my computer.
I updated my app in IIS and I get this error when calling the web service that converts the docx to pdf:
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
I have tried several answers and tutorials step by step such as:
Accessing Office Word object model through asp.net results in "failed due to the following error: 80070005 Access is denied."
Retrieving the COM class factory for component with CLSID failed due to the following error: 80070005 Access is denied
https://jayeshsidhwani.wordpress.com/tag/hresult-0x80070005-e_accessdenied/
https://waheedrous.wordpress.com/2014/01/26/error-office-interop-assemblies
But I got to nowhere.
I also tried to run my app in the server but as localhost and it worked perfectly, zero problems.
I noticed that the CLSID in the error message it isn't the same as the Microsoft Word 97 - 2003 Document Component Service App ID.
The only tutorial that got me somewhere is this one http://toastergremlin.com/?p=543. The error was gone but the Word wasn't being opened and the web service just got stuck.
In the Microsoft Word 97 - 2003 Document Component Service I tried to add the following users: NETWORK_SERVICE, IIS_IUSRS, PC\Users and the apppool associated with my website.
I had similar issue when trying to create my own Interop DLL thru IIS web. And after lot of searches, this post solved my life
I have created a windows service that repetitively updates the same excel file. While running the Windows Service, I am receiving the following Error:
Error Message Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
This error is thrown at the following line of code:
ExcelApp = new Microsoft.Office.Interop.Excel.Application();
Is there a work-around for this ?
I followed the steps mentioned in the following SO link but that didn't helped me overcome these error. I tried solution from few other questions as well and none of them worked for me.
After downgrading from Excel 2013 to 2010 (i.e. removing 2013 and installing 2010) when I try to access the Excel OM from my add-in like this:
if (this.Application.ActiveWorkbook == null)
{
return;
}
I get the following Exception:
Unable to cast COM object of type 'System.__ComObject' to interface
type 'Microsoft.Office.Interop.Excel._Application'. This operation
failed because the QueryInterface call on the COM component for the
interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due
to the following error: Library not registered. (Exception from
HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
I have taken the following steps to resolve the issue but none have worked:
Repaired the office installation
Uninstalled and reinstalled
Cleared out all office 15 references from the registry
Re-registered Excel ("C:\Program Files (x86)\Microsoft Office\Office14\excel.exe" /o)
However, nothing seems to work. Is there something I'm missing or do I actually have to wipe the machine?
EDIT:
My guess is that there is still come conflict in the registry but I have no idea where...
Thanks in adv!
Found the solution - I forgot to remove one reference to Excel 2013:
HKEY_CLASSES_ROOT\TypeLib{00020813-0000-0000-C000-000000000046}\1.8
After removing 1.8 my corrected registry looks like this:
...
Credit: http://www.c-sharpcorner.com/Forums/Thread/203666/unable-to-cast-com-object-of-type-microsoft-office-inte.aspx
my .net web application has a option of uploading a excel file, which has around 1k entries of products, the upload works fine when i run the application on localhost, but results in the following error when it is hosted on iis7 & accessed by some other computer on the network..
error
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
I googld it, and found some talking about 32-bit or 64-bit OS.
Thanks.
You should avoid using Excel Interop in a server application for the reasons described in this KB article.
Instead, consider using a third-party product to manipulate the Excel document, such as EPPlus (Excel 2007+), Aspose Cells, SpreadsheetGear.
Probably your ASP.NET app is running under an account that doesn't have a profile.
Ensure the upload folder is given full permission so as to upload from other computers. First start by giving permission to EVERYONE. Then you may restrict it to IIS user only.
Sounds to me that when your implementing your application on the server, something isn't getting installed that your using on your development machine. Whatever your using to upload, if it is a third party upload control or something, you might not be distributing that file.
Another possibility is, that the server your installing your application on is a 64 bit machine, and the upload control your using is built for 32 bit only. You might want to set the server to 32 bit for IIS 7.
http://www.depotsystems.com/ds_mobile_webhelp/webhelp/index.htm#page=Enabling_32_bit_mode.htm