Results 1 to 3 of 3

Thread: Open Excel w/ asp .net (VB)

  1. #1

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342

    Open Excel w/ asp .net (VB)

    I'm trying to open excel with asp .net using vb. I have the code right, but I'm getting this access denied error. I've tried to do what it says to fix it, but nothing works, I keep getting the same message. I've tried setting access rights to the "ASPNET" account to admin and I have changed the username/pass in the mashine.config file to "system/autogenerate" (this was suggested on microsoft's site).

    Here's the message I get:
    Server Error in '/WebApplication6' Application.
    --------------------------------------------------------------------------------

    Access is denied.
    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: Access is denied.

    The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

    Source Error:


    Line 31:
    Line 32: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Line 33: Dim objExcelApp As New Excel.Application()
    Line 34:
    Line 35: objExcelApp.Charts.Add()


    Source File: G:\WebServer\WebApplication6\WebForm1.aspx.vb Line: 33

    Stack Trace:


    [UnauthorizedAccessException: Access is denied.]
    WebApplication6.WebForm1.Page_Load(Object sender, EventArgs e) in G:\WebServer\WebApplication6\WebForm1.aspx.vb:33
    System.Web.UI.Control.OnLoad(EventArgs e)
    System.Web.UI.Control.LoadRecursive()
    System.Web.UI.Page.ProcessRequestMain()




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
    Any ideas? I'm fairly desperate. If I get this to work, It will make my life incredibly easier.

    Thanks,

    Paul

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    here are some msdn newsgroup posting of people having the same or similar issues. See if there is any responses there that may help you

    http://www.dotnet247.com/247referenc...ption.aspx?v=2
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342
    I've went through everything (twice) that is recommended... everyone talks about changing parameters in that machine.config file. I've done what's recommended there. I've also used DCOMCNFG.exe and set the authentication level to none, I also messed with where it is run from (set it to my server, and the other options). This is killing me.

    One of the biggest and only reasons I bought visual studio .net is because I was told (not by anyone here) that anything that can be done in a VB 6.0 App could be done with ASP .NET VB. This is the same problem I had in ASP 3.0... I couldn't interact with a client application without using some third party COM. Damn Damn Damn

    Sorry for venting... If anybody finds a solution for this, please let me know. I'll be happy to read through more links also.

    Thanks,

    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width