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

Discussion in 'ASP .Net' started by Michael Tkachev, Oct 7, 2004.

  1. 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?
    --
    Sincerely yours,
    Michael Tkachev.
    ..Net Developer
    Michael Tkachev, Oct 7, 2004
    #1
    1. Advertising

  2. 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

    "Michael Tkachev" wrote:

    > 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?
    > --
    > Sincerely yours,
    > Michael Tkachev.
    > ..Net Developer
    >
    =?Utf-8?B?UHJhdmVlbiBL?=, Oct 7, 2004
    #2
    1. Advertising

  3. 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


    "Michael Tkachev" <> wrote in message news:...
    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?
    --
    Sincerely yours,
    Michael Tkachev.
    .Net Developer
    Steve C. Orr [MVP, MCSD], Oct 7, 2004
    #3
  4. 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




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Michael Tkachev, Oct 8, 2004
    #4
  5. Michael Tkachev

    Larry Neblett

    Joined:
    Sep 28, 2012
    Messages:
    2
    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.
    Larry Neblett, Sep 28, 2012
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anan
    Replies:
    8
    Views:
    15,609
    John C. Bollinger
    Dec 8, 2004
  2. Ben
    Replies:
    9
    Views:
    1,160
    John Timney \(MVP\)
    Jun 8, 2006
  3. Jeff
    Replies:
    2
    Views:
    924
    clintonG
    Sep 19, 2006
  4. Ryan Taylor
    Replies:
    1
    Views:
    668
    Ryan Taylor
    Sep 9, 2004
  5. Andrew Martin

    allow write access for logged-in user

    Andrew Martin, Mar 4, 2007, in forum: ASP .Net Security
    Replies:
    1
    Views:
    102
    Dominick Baier
    Mar 4, 2007
Loading...

Share This Page