Web service in .net not able to create Excel com object

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default 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 object using
    Dim objXl As New Microsoft.Office.Interop.Excel.Application()
    objXl.Workbooks.Open("C:\C\Test.xls")
    objXl.Visible = True
    However, I am getting the error Access denied, Cannot create Activex component.
    The same code works in a ASP page and also in .net windows application.
    But if I access this code through web service I get the error Access denied, Cannot create Activex component.
    I checked the permissions etc for this web service project
    Could anyone please help me please.
    --------------------------------
    From: Nalina Vemparala

    -----------------------
    Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])

    <Id>K4FlI6gD5EyFFDUQg55O5g==</Id>
    Nalina Vemparala via .NET 247 Guest

  2. Similar Questions and Discussions

    1. Cannot Create New Instance of COM+ Object After You Repeatedly Restart the COM+ Object
      I've checked that the server I'm working on has win2k sp4 which had a fix from microsoft for this problem. However, it seems that I still have...
    2. 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...
    3. 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...
    4. Create Excel worksheet by using web service
      I want to create a excel file by using web serivce. Can web service do that? and how? Thanks.
    5. 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...
  3. #2

    Default Re: Web service in .net not able to create Excel com object

    the asp.net process runs under a special user. that user will not by
    default have rights to resources outside the scope of the web service.
    imagine what would happen if a web service could call ANY code on your
    server. there are many ways to approach this depending on your environment
    and what it is that you are trying to achieve. but at the most basic level,
    you need to give the aspnet user the rights to launch excel.

    "Nalina Vemparala via .NET 247" <anonymous@dotnet247.com> wrote in message
    news:#tvUZyMJEHA.1192@TK2MSFTNGP11.phx.gbl...
    > (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 object using
    > Dim objXl As New Microsoft.Office.Interop.Excel.Application()
    > objXl.Workbooks.Open("C:\C\Test.xls")
    > objXl.Visible = True
    > However, I am getting the error Access denied, Cannot create Activex
    component.
    > The same code works in a ASP page and also in .net windows application.
    > But if I access this code through web service I get the error Access
    denied, Cannot create Activex component.
    > I checked the permissions etc for this web service project
    > Could anyone please help me please.
    > --------------------------------
    > From: Nalina Vemparala
    >
    > -----------------------
    > Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])
    >
    > <Id>K4FlI6gD5EyFFDUQg55O5g==</Id>

    Joe H Guest

  4. #3

    Default Re: Web service in .net not able to create Excel com object

    Also, let's repeat that MS Office components were not designed to be used
    from within server-based apps such as ASP.NET webservices (or ASP Pages for
    that matter).

    [url]http://support.microsoft.com/default.aspx?scid=kb;EN-US;257757[/url]


    --
    Dino Chiesa
    Microsoft Developer Division
    d i n o c h @ ElideThis . m i c r o s o f t . c o m



    "Joe H" <jharri@hotmail.com> wrote in message
    news:%23HNzjCVJEHA.2380@TK2MSFTNGP09.phx.gbl...
    > the asp.net process runs under a special user. that user will not by
    > default have rights to resources outside the scope of the web service.
    > imagine what would happen if a web service could call ANY code on your
    > server. there are many ways to approach this depending on your
    environment
    > and what it is that you are trying to achieve. but at the most basic
    level,
    > you need to give the aspnet user the rights to launch excel.
    >
    > "Nalina Vemparala via .NET 247" <anonymous@dotnet247.com> wrote in message
    > news:#tvUZyMJEHA.1192@TK2MSFTNGP11.phx.gbl...
    > > (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 object using
    > > Dim objXl As New Microsoft.Office.Interop.Excel.Application()
    > > objXl.Workbooks.Open("C:\C\Test.xls")
    > > objXl.Visible = True
    > > However, I am getting the error Access denied, Cannot create Activex
    > component.
    > > The same code works in a ASP page and also in .net windows application.
    > > But if I access this code through web service I get the error Access
    > denied, Cannot create Activex component.
    > > I checked the permissions etc for this web service project
    > > Could anyone please help me please.
    > > --------------------------------
    > > From: Nalina Vemparala
    > >
    > > -----------------------
    > > Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])
    > >
    > > <Id>K4FlI6gD5EyFFDUQg55O5g==</Id>
    >
    >

    Dino Chiesa [Microsoft] Guest

  5. #4

    Default Re: Web service in .net not able to create Excel com object

    Hi,
    use "dcomcnfg.exe" to config your policy for Dcom
    select the "Default Security pane", insert user everyOne and give it "special Access" right into the tre
    option allowed
    Restart Your system and good luck

    N.B.: Word works very well but Excel not finds the default printer specified i
    system registrykeys "[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\"
    devices, printerports and windows like Microsoft suggests

    freekamel 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