Home All Groups Group Topic Archive Search About

System.UnauthorizedAccessException while importing data from Excel

Author
2 Aug 2006 9:13 AM
Abhijeet Kumar
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

Author
4 Aug 2006 5:51 PM
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.




Show quote
"Abhijeet Kumar" <AbhijeetKu***@discussions.microsoft.com> wrote in message
news:FEF502B2-A46D-49C0-88EC-FC40725EF6F0@microsoft.com...
> 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
>

AddThis Social Bookmark Button