How can I allow access for a "ASP.Net" user in Excel?

  • Thread starter Michael Tkachev
  • Start date
M

Michael Tkachev

Hello,

I need to create an "Excel" file in the ASP.net. But a security system doesn't allow to do it.
What can I do? There is an exception heppens when I try to execute the following row:

Excel.ApplicationClass c = new Excel.ApplicationClass();

Exception Details: System.UnauthorizedAccessException: Access is denied.

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.


Who have any idias?
 
G

Guest

Hi Michael,
I think its a problem of your component which you are using to create
the excel application. you are add the dll into the GAC, later on in the user
accounts in the control panel set the permissions for the users. If this
doesn't helps you out.

in the Start >> Run >> Type DComcnfg the DCOM configuration application
apprears in that select your component ie. microsoft APplication object and
in that right click, in the security tab, provide the permissions to that
components. that will solve your problem
 
S

Steve C. Orr [MVP, MCSD]

This article contains the information you need to work with Excel files from
ASP.NET:
http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


Hello,

I need to create an "Excel" file in the ASP.net. But a security system doesn't allow to do it.
What can I do? There is an exception heppens when I try to execute the following row:

Excel.ApplicationClass c = new Excel.ApplicationClass();

Exception Details: System.UnauthorizedAccessException: Access is denied.

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.


Who have any idias?
 
M

Michael Tkachev

Hello,


Thank you very much. I read the article and the I downloaded an example,
but when I tryed to
run this example, an application returns the following exception:

Exception Details: System.Runtime.InteropServices.COMException: Old
format or invalid type library.

Source Error:
Line 34: object o = new object();
Line 35:
Line 36: a.Save(@"c:\1\11.xls");

what wrong here?
I'm using Windows-2000 pro, Office-XP.

Thanks

Michael
 
Joined
Sep 28, 2012
Messages
2
Reaction score
0
Maybe my post will help someone. There is a useful .NET component Excel Jetcell that does not require ms excel installed in the server. So each developer can easily create Excel XLS XSLX files in his .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

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top