• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1010
  • Last Modified:

Error accessing Office Web Components from production server in ASP.NET

Hey All,

I am writing an "ExportToExcel" function which takes a simple datatable and exports it to excel.  I am using this to ensure the number formatting comes out correctly since CSV automatically imports text as numbers.
I added a refeerence to OWC11 in my development machine, built the code and ran it and it works.  But when I copied to my production server I am getting errors: "Retrieving the COM class factory for component with CLSID {0002E569-0000-0000-C000-000000000046} failed due to the following error: 80040111. "

I have installed Visual studio and office on the production server, along with the Office Web Components DLL, but am still getting the error.  I have looked for the COM object in DCOMCNFG, but it was not present.  I set permissions to Full Control for Everyone out of desperation, but that also failed.

The system throws the error as soon as I try to instantiate OWC11.SpreadsheetClass() as a new object.  Everything I have read says permissions, but I am unable to find anything that works.

Thanks,
Geoff
0
GeoffSutton
Asked:
GeoffSutton
  • 3
  • 2
1 Solution
 
masterpassCommented:
Hope this will help you

http://blog.crowe.co.nz/archive/2006/03/02/589.aspx

Have a special look at the NOTE in the article towards the end
0
 
GeoffSuttonAuthor Commented:
Hey Masterpass.  
I have already been through this article.  It's where I got the idea that it was a permissions issue, and was looking at DCOMCNFG.  With no results, unfortunately.  I am now trying some of the additinoal tips in the comments to see if I can force a resolution.  Any other ideas?

Thanks,
Geoff
0
 
masterpassCommented:
I had this error once, which took me into this blog ....

this is what solved my error :

Remember if you are running on Windows 2003 Server you must use the application pool identity as the account and not the ASPNET account.

you have to give permissions for the NETWORK SERVICE and NETWORK

I think you will have it solved then !!!
0
 
GeoffSuttonAuthor Commented:
The problem is it's not the same error.  Also the OWC11 is not showing up in the DCOMCNFG application, which makes thing more difficult.  I will set different NTFS permissions on it, but that's he best I can do.
Geoff
0
 
GeoffSuttonAuthor Commented:
Turns out you were right :)  Assigning full control to "EVERYONE" didn't succeed, but assigning it to Network and to IIS_IUSR<machinename> worked perfectly.  I guess I just didn't read far enough into the article.
Thanks so much.
Geoff
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now