Solved

Retrieving the COM class factory for component with CLSID - error with excel

Posted on 2014-10-20
12
1,669 Views
Last Modified: 2016-06-10
I am creating an Excel file in my VB.NET application. It works fine on development server but is throwing this error on production server

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 have looked at few links like
http://stackoverflow.com/questions/17785063/retrieving-the-com-class-factory-for-component-error-80070005-access-is-de

They all say i need to go to DCOM Config. But I can't find Microsoft Excel under DCOM config on the production server.
What are my options?
0
Comment
Question by:Angel02
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 33

Expert Comment

by:it_saige
ID: 40392766
Did you install the Office Runtime or Office Pro on your server?

-saige-
0
 

Author Comment

by:Angel02
ID: 40392795
I have Office 2003 and 2007 installed. Do I need to install Office runtime separately?
0
 
LVL 33

Assisted Solution

by:it_saige
it_saige earned 500 total points
ID: 40392821
As long as you have office installed, there is no need for the Runtime.  It is possible that you cannot find the com component because you have a 32bit office installed over a 64bit os.  Refer to this document for ensuring that your interop assemblies are installed properly.

http://waheedrous.wordpress.com/2014/01/26/error-office-interop-assemblies/

-saige-
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:Angel02
ID: 40392965
Thank you Saige. I did as it is mentioned in the link.
When I Customize - Launch and Activation Permissions and Access Permission, which is the user I need to add and give permissions to?

I am creating the excel file in a public facing web application and all users will need the access. Please advise.
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40392985
Just off-hand, I would imagine it would be IIS_IUSRS.

-saige-
0
 

Author Comment

by:Angel02
ID: 40393158
I followed the link and got rid of the access denied error. Now I am getting

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space.

• To make more memory available, close workbooks or programs you no longer need.

• To free disk space, delete files you no longer need from the disk you are saving to

What does this mean? Please advise.
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40393173
Potentially caused by an invalid Localization configuration:

http://www.made4dotnet.com/Default.aspx?tabid=141&aid=15

-saige-
0
 

Author Comment

by:Angel02
ID: 40413821
I tried localization configuration but it did not work. I also gave some permissions in IIS. Still getting the same error.

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space.

I am thinking about another option to run a SQL procedure and have it save an Excel on the SQL Server in a network folder. Then the web application could read the file from that network folder. Is it a good and safe option for a public web application?
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40413842
Try setting Full control permissions to the folder that you are creating the Excel file in to the "IIS AppPool\WhichEverAppPoolYouAreUsing"; e.g. - "IIS AppPool\DefaultAppPool".

If you are saving the to the root folder of the site, then I would recommend that you save to a different folder with the settings above configured.

http://forums.asp.net/t/1585488.aspx?System+Runtime+InteropServices+COMException+0x800A03EC+Microsoft+Excel+cannot+open+or+save+any+more+documents+

-saige-
0
 
LVL 33

Accepted Solution

by:
it_saige earned 500 total points
ID: 40413870
You may also be able to resolve this by setting Excel to run as Administrator in the DCOMCNFG:

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22788906.html

-saige-
0
 

Author Comment

by:Angel02
ID: 40447833
I had to run as administrator in the DCOMCNFG and also make sure I was the local administrator on the server.
0
 
LVL 1

Expert Comment

by:Sharath B
ID: 41647279
As saige mentioned IIS_IUSRS  needs to have all permissions. This worked for me.
Also make sure Authentication level is set to "None".
Identity is set to "The interactive user"
Thanks saige.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question