Ask a Question related to ASP, Design and Development.

  1. #1

    Default Excel object in ASP

    I am trying to use an excel spreedsheet on an asp.net page.
    The follow code works (with output mod.) in a .net console
    application. When I try to run this code in asp.net,
    the "dim new excel app" statement fails
    with "System.UnauthorizedAccessException: Access is
    denied."
    Are there some security settings I need to tweek to
    instantiate an Excel object in VB.NET ?
    Any ideas would be appreciated.
    Regards,
    KLomax

    Try
    Dim objExcel As New Excel.Application()
    objExcel.Workbooks.Open("C:\TEMP\TestExcel.xls")
    Label1.Text = _
    objExcel.ActiveSheet.Cells(1,1).Value.ToString
    objExcel.Workbooks.Close()
    Catch exp As Exception
    Label1.Text = exp.ToString
    End Try
    KLomax Guest

  2. Similar Questions and Discussions

    1. Excel create object error
      Hello! I have an ASP page that creates an Excel object: set lobjXLSApplication = CreateObject("Excel.Application") This used to run fine on my...
    2. COM Object Excel
      Hi, I was using a Coldfusion 4.5 server on a windows NT platform on which I was exporting datas in a Excel 97 using COM object. I've migrated all...
    3. Web service in .net not able to create Excel com object
      (Type your message here) Hi! I created a web service in .net where in the web method makes call to a function in which I am creating an excel...
    4. Problem on the ASP using the Excel.Application Object
      Hi, All: I want to use excel component in the ASP. My code is that ----------------------------------------------------------- Dim oExcel As...
    5. Excel COM object not being destroyed
      Hi everyone, I have a .NET component (DLL) that uses Excel (creates workbook, adds some data, saves workbook, quits Excel) If I call this...
  3. #2

    Default RE: Excel object in ASP

    By Default, an ASP.NET application will use the account "aspnet". This
    account on your computer may not have enough permission to create the Excel
    object. You can try to add this account to local administrators group, or
    you can open up macine.config and look at the processModel' username
    attribute, you will find which NT account your ASP.NET worker process is
    running. Usually it's MACHINE or SYSTEM (where the latter one has more
    rights to certain COM objects). See if you can play it with SYSTEM account.

    Luke

    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    MSFT Guest

  4. #3

    Default RE: Excel object in ASP

    Changing the processModel.username to "SYSTEM" did the
    trick.

    Thanks Luke
    >-----Original Message-----
    >By Default, an ASP.NET application will use the
    account "aspnet". This
    >account on your computer may not have enough permission
    to create the Excel
    >object. You can try to add this account to local
    administrators group, or
    >you can open up macine.config and look at the
    processModel' username
    >attribute, you will find which NT account your ASP.NET
    worker process is
    >running. Usually it's MACHINE or SYSTEM (where the latter
    one has more
    >rights to certain COM objects). See if you can play it
    with SYSTEM account.
    >
    >Luke
    >
    >(This posting is provided "AS IS", with no warranties,
    and confers no
    >rights.)
    >
    >.
    >
    KLomax Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139