0

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.

Community
  • 1
  • 1
Nikhar
  • 1,074
  • 8
  • 23
  • seems to be permission issue .. – Pranav Mar 13 '13 at 07:27
  • @Pranav is there anything that can be done – Nikhar Mar 13 '13 at 07:46
  • 1
    try to give the permission to DefaultAppPool ...see this link :- http://www.iis.net/learn/manage/configuring-security/application-pool-identities – Pranav Mar 13 '13 at 08:00
  • 1
    also some helpful link :- http://stackoverflow.com/questions/1491123/system-unauthorizedaccessexception-retrieving-the-com-class-factory-for-word-in – Pranav Mar 13 '13 at 08:02
  • @Pranav thanks, i have to do both the things to get it working, also in my case i changed `microsoft excel application` properties. – Nikhar Mar 13 '13 at 11:41

3 Answers3

2

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.

Joe
  • 122,218
  • 32
  • 205
  • 338
1

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.

Ajoe
  • 67
  • 8
1

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

Bitco Software
  • 405
  • 1
  • 5
  • 15