System.UnauthorizedAccessException while importing data from Excel

G

Guest

Hi
I am Importing data from Excel sheet to our ASP.NET Application. It works
fine when i run the code. But when i create installer for the same and try to
import Excel file through installed application it gives me error as:

Retrieving the COM class factory for component with CLSID
{00024500-0000-0000-C000-000000000046} failed due to the following error:
80070005.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

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.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.

I am using .NET 2005 on windows 2000, I have excel 2003 installed on my
machine.

Please help.
Thanks
 
N

Nicole Calinoiu

You will probably need to modify the permissions on the
HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046} and
HKEY_CLASSES_ROOT\Excel.Application registry keys to allow them to be read
by your execution context user. If you're not sure which user account is
providing the execution context, try reading the value of
WindowsIdentity.GetCurrent().Name from within your ASP.NET application.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top