Retrieving the COM class factory for component failed
Asked Answered
I

11

28

I am using an excel object (COM component) for excel manipulation. It works fine on my PC, but when I deploy the application to our Intranet I am getting this error:

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005

I am using windows authentication and impersonate=true in my web.config.

I made all the settings in component service but it still gives the same error.

Please help

Ipa answered 19/5, 2009 at 5:47 Comment(2)
did you find a working solution with this question? I just hit this question with the same problem. I'm running a VB.Net app, not Asp.Net.Amund
never mind, I had to install the .Net functionality of Excel from the Office installer. Silly meAmund
F
27

I had the same error when I deployed my app. I've got solution from this site: Component with CLSID XXX failed due to the following error: 80070005 Access is denied

Here is this solution:

  1. In DCOMCNFG, right click on the My Computer and select properties.

  2. Choose the COM Securities tab.

  3. In Access Permissions, click Edit Defaults and add Network Service to it and give it Allow local access permission. Do the same for < Machine_name >\Users.

  4. In Launch and Activation Permissions, click Edit Defaults and add Network Service to it and give it Local launch and Local Activation permission. Do the same for < Machine_name >\Users.

*I used forms authentication.

Fleer answered 19/8, 2014 at 9:43 Comment(3)
I can't remember which version of system I had. Did you try this solution?Fleer
This worked for me, after searching a solution for about 10 hours. The other solutions mention specific programs to change the permissions for, or to change the binary (dll) builds. This mentions the root (My Computer) and correct 'user's. +1.Poussette
Adding permissions to all components is a security risk. It's preferred to give permissions only to the specific component that needs themTextuary
C
6

This did the trick for me: (solution from the msdn forum)

goto Controlpanel --> Administrative tools-->Component Services -->computers --> myComputer -->DCOM Config --> Microsoft Excel Application.

right click to get properties dialog. Goto Security tab and customize permissions accordingly.

In Launch and Application Permissions, select Customize, Edit. Add the user / group that calls the application.

Continuity answered 11/2, 2011 at 22:14 Comment(0)
A
5

There's one more issue you might need to address if you are using the Windows 2008 Server with IIS7. The server might report the following error:

Microsoft Office Excel cannot access the file 'c:\temp\test.xls'. There are several possible reasons:

  • The file name or path does not exist.
  • The file is being used by another program.
  • The workbook you are trying to save has the same name as a currently open workbook.

The solution is posted here (look for the text posted by user Ogawa): http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91?prof=required

Ananna answered 7/7, 2009 at 10:8 Comment(1)
+1000 for server 2008 x64 add folder C:\Windows\SysWOW64\config\systemprofile\Desktop bingo!!!Impostume
D
4

You will also get this error when there are stale EXCEL.EXE processes in the system (Use Task Manager --> Processes tab to view these.)

Kill all those instances and the application would work normally.

Diadem answered 2/3, 2011 at 10:45 Comment(0)
D
2

In case it helps somebody:

I am running Windows 7 64-bit and I wanted to register a 32-bit dll.

First I tried: regsvr32 <path\name.dll> and got the following error:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {A1D59B81-C868-4F66-B58F-AC94A4A7982E} failed due to the following error: 80040154.

Then I tried to add the application through the Component Services (Run->DCCOMCNFG) and got the following error:

System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {A1D59B81-C868-4F66-B58F-AC94A4A7982E} failed due to the following error: 80070005.

There are many links to solving it but what worked for me was: Console Root -> Component Services -> Computers -> My Computer -> COM+ Applications -> your_application_name -> Properties: Security tab: Authorization: Uncheck 'Enforce access checks for this application'.

I don't know what it does.

Detonator answered 29/7, 2010 at 22:1 Comment(0)
M
2

I have Done the Following Things in IIS 8.5 (Windows Server 2012 R2)Server and its Worked in My Case Without Restart:

  1. Selecting The Application Pool That Connected to The Application in IIS

  2. And Right Click --> Advanced Settings --> Process Model --> Select Local System Instead of Recommended ApplicationPoolIdentity

  3. And Make Sure C:\Windows\SysWOW64\config\systemprofile\desktop Have Enough Access For Users.

  4. Refresh the Website Link that Connected With this Pool


enter image description here

Montmartre answered 4/1, 2019 at 6:43 Comment(1)
You're giving high privileges to an application pool. Your server can be hacked easily.Textuary
G
1

I can understand your pain. In my case the error got resolved by performing below steps:

  1. Start > Run > dcomcnfg.
  2. Open the folder DCOM Config and Select Component Services > Computers > My Computer > DCOM Config.
  3. Select “Microsoft Office Word 97 – 2003 document”/”Microsoft Excel Application” and go to its properties.
  4. In "Security" tab set “Launch and Activation Permissions” need to be Customize (Authorized user).
  5. Now go to IIS and select application pool of the Web and go to its Advanced Settings and select “NETWORK SERVICE” as identity user.

Hope this helps.

Glossator answered 23/5, 2017 at 12:21 Comment(0)
E
1

I'm getting this same error when trying to export a csv file from Act! to Excel. One workaround I found was to run Act! as an administrator.

That tells me this is probably some sort of permission issue but none of the previous answers here solved the problem. I tried running DCOMCNFG and changing the permissions on the whole computer, and I also tried to just change permissions on the Excel component but it's not listed in DCOMCNFG on my Windows 10 Pro PC.

Maybe this workaround will help someone until a better solution is found.

Er answered 3/12, 2020 at 14:7 Comment(0)
P
0

The CLSID you describe is for the Microsoft.Office.Interop.Excel.ApplicationClass. This class basically launches excel.exe through InprocServer32. If you don't have it installed then it will return the error message you received above.

Pasteur answered 2/12, 2013 at 17:39 Comment(3)
Yes, Excel is not installed on the server machine. Is there any other way to use Interop without installing excel on the server machine. I am asking this because I cannot have access to install any other software on the server machine.Abohm
I don't think there is. Excel.exe is kind of like the engine. You might be able to develop Web Service on another computer (that has Excel) then call that web service from the server to process the request and send back the result. This would require strong Windows and .NET programming skills. There are also third-party libraries out there to manipulate Excel documents.Pasteur
@UmerFarooq How to simple Web Service support.microsoft.com/en-us/kb/308359 . Returning large data in Web Service msdn.microsoft.com/en-us/library/aa528822.aspx .Pasteur
Y
0

For IIS 8 I did basically the same thing as Monic. Im running my application as its own app pool on an x64 machine 1.In DCOMCNFG, right click on the My Computer and select properties.

2.Choose the COM Securities tab.

3.In Access Permissions, click Edit Defaults and add iis apppool\myapp to it and give it Allow local access permission. Do the same for iis apppool\myapp

4.In launch and Activation Permissions, click Edit Defaults and add iis apppool\myapp to it and give it Local launch and Local Activation permission. Do the same for iis apppool\myapp.

additionally I had to make the folders outlined under C:\Windows\SysWOW64\config\systemprofile\Desktop and give read \ write permissions to iis apppool\myapp also

Yusem answered 1/11, 2014 at 1:4 Comment(0)
B
0

If you run the app from the Task Scheduler, it helps to check option in General parameters "Run with highest privileges".

Bespangle answered 3/6, 2022 at 11:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.