Link to home
Start Free TrialLog in
Avatar of Angel02
Angel02

asked on

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

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?
Avatar of it_saige
it_saige
Flag of United States of America image

Did you install the Office Runtime or Office Pro on your server?

-saige-
Avatar of Angel02
Angel02

ASKER

I have Office 2003 and 2007 installed. Do I need to install Office runtime separately?
SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Angel02

ASKER

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.
Just off-hand, I would imagine it would be IIS_IUSRS.

-saige-
Avatar of Angel02

ASKER

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.
Potentially caused by an invalid Localization configuration:

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

-saige-
Avatar of Angel02

ASKER

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?
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-
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Angel02

ASKER

I had to run as administrator in the DCOMCNFG and also make sure I was the local administrator on the server.
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.