[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

CreateObject("Excel.Application",MyServer

KC

9/28/2004 8:25:00 PM

Hi,
I have code similar to this..
Dim xlApp As Object
xlApp = CreateObject("Excel.Application", "\\MyServer")

The call is from a asp.net (Intranet) application. \\Myserver is a network
computer in the same domain as web server. The only way I can get this call
worked is when I add the user who logs on to the web site as Administrators.
I need to get this working without having to make the user administrator.
Any suggestion?
Thanks,
CK


5 Answers

Dmitriy Lapshin

9/29/2004 12:12:00 PM

0

Hi KC,

You can grant permissions to the user your ASP .NET app runs under to access
the Excel COM server by running dcomcnfg on the "MyServer" machine. For
this, the aforementioned user should be a domain user. You could possibly
also impersonate a domain user with enough permissions before instantiating
and using the Excel object.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/tests...

"KC" <chhatra@hotmail.com> wrote in message
news:OAagClZpEHA.3324@TK2MSFTNGP15.phx.gbl...
> Hi,
> I have code similar to this..
> Dim xlApp As Object
> xlApp = CreateObject("Excel.Application", "\\MyServer")
>
> The call is from a asp.net (Intranet) application. \\Myserver is a network
> computer in the same domain as web server. The only way I can get this
> call
> worked is when I add the user who logs on to the web site as
> Administrators.
> I need to get this working without having to make the user administrator.
> Any suggestion?
> Thanks,
> CK
>
>

Tony Proctor

9/29/2004 12:46:00 PM

0

Please do not include VB "classic" newsgroups for a VB.Net question. They're
not the same

Tony Proctor

"Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com> wrote
in message news:u2V3B2hpEHA.3324@TK2MSFTNGP15.phx.gbl...
> Hi KC,
>
> You can grant permissions to the user your ASP .NET app runs under to
access
> the Excel COM server by running dcomcnfg on the "MyServer" machine. For
> this, the aforementioned user should be a domain user. You could possibly
> also impersonate a domain user with enough permissions before
instantiating
> and using the Excel object.
>
> --
> Sincerely,
> Dmitriy Lapshin [C# / .NET MVP]
> Bring the power of unit testing to the VS .NET IDE today!
> http://www.x-unity.net/tests...
>
> "KC" <chhatra@hotmail.com> wrote in message
> news:OAagClZpEHA.3324@TK2MSFTNGP15.phx.gbl...
> > Hi,
> > I have code similar to this..
> > Dim xlApp As Object
> > xlApp = CreateObject("Excel.Application", "\\MyServer")
> >
> > The call is from a asp.net (Intranet) application. \\Myserver is a
network
> > computer in the same domain as web server. The only way I can get this
> > call
> > worked is when I add the user who logs on to the web site as
> > Administrators.
> > I need to get this working without having to make the user
administrator.
> > Any suggestion?
> > Thanks,
> > CK
> >
> >
>


Paul Clement

9/29/2004 1:43:00 PM

0

On Tue, 28 Sep 2004 13:24:56 -0700, "KC" <chhatra@hotmail.com> wrote:

¤ Hi,
¤ I have code similar to this..
¤ Dim xlApp As Object
¤ xlApp = CreateObject("Excel.Application", "\\MyServer")
¤
¤ The call is from a asp.net (Intranet) application. \\Myserver is a network
¤ computer in the same domain as web server. The only way I can get this call
¤ worked is when I add the user who logs on to the web site as Administrators.
¤ I need to get this working without having to make the user administrator.
¤ Any suggestion?
¤ Thanks,
¤ CK

I would recommend checking out the following article:

INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/default.aspx?scid=kb;en...


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

KC

9/29/2004 3:40:00 PM

0

Yes, I added the domain user under dcomcnfg on MyServer and I am able to
pass CreateObject("Excel.Application",MyServer). But once I do
xlApp.Workbooks.Add(Path), this is where it is choking. The user has access
to "Path" and the excel file..



"Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com> wrote
in message news:u2V3B2hpEHA.3324@TK2MSFTNGP15.phx.gbl...
> Hi KC,
>
> You can grant permissions to the user your ASP .NET app runs under to
access
> the Excel COM server by running dcomcnfg on the "MyServer" machine. For
> this, the aforementioned user should be a domain user. You could possibly
> also impersonate a domain user with enough permissions before
instantiating
> and using the Excel object.
>
> --
> Sincerely,
> Dmitriy Lapshin [C# / .NET MVP]
> Bring the power of unit testing to the VS .NET IDE today!
> http://www.x-unity.net/tests...
>
> "KC" <chhatra@hotmail.com> wrote in message
> news:OAagClZpEHA.3324@TK2MSFTNGP15.phx.gbl...
> > Hi,
> > I have code similar to this..
> > Dim xlApp As Object
> > xlApp = CreateObject("Excel.Application", "\\MyServer")
> >
> > The call is from a asp.net (Intranet) application. \\Myserver is a
network
> > computer in the same domain as web server. The only way I can get this
> > call
> > worked is when I add the user who logs on to the web site as
> > Administrators.
> > I need to get this working without having to make the user
administrator.
> > Any suggestion?
> > Thanks,
> > CK
> >
> >
>


KC

10/5/2004 2:16:00 AM

0

Hi,
I finally got the CreateObject("Excel.Application",\\MyServer) working but I
have another serious problem.
I open the Excel.Application in remoter server and open the workbook and
read and process the data. But the process is done, the Excel instance
doesn't close and it creates a new instance every time. Here is my code.

Please help..

Dim objExcelApp As Excel.Application
Dim objWorkBook As Excel.Workbook
Dim objWorkSheet As Excel.Worksheet
Dim objRange As Excel.Range
objExcelApp = CType(CreateObject("Excel.Application",
ConfigurationSettings.AppSettings("AppServer")), Excel.Application)
objExcelApp.DisplayAlerts = False
objWorkBook = CType(objExcelApp.Workbooks.Add(WorkBookPath), Excel.Workbook)
objWorkSheet =
CType(objWorkBook.Worksheets(ConfigurationSettings.AppSettings("WorkSheetPat
h")), Excel.Worksheet)


''Do the processing......................

ReleaseComObject(objWorkSheet)
ReleaseComObject(objWorkBook)
ReleaseComObject(objExcelApp)

objRange = Nothing
objWorkBook = Nothing
objWorkSheet = Nothing
objExcelApp = nothing

If Not IsNothing(objExcelApp) Then
objExcelApp.DisplayAlerts = False
objExcelApp.Quit()
objExcelApp = Nothing
End If

GC.Collect()






"Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com> wrote
in message news:u2V3B2hpEHA.3324@TK2MSFTNGP15.phx.gbl...
> Hi KC,
>
> You can grant permissions to the user your ASP .NET app runs under to
access
> the Excel COM server by running dcomcnfg on the "MyServer" machine. For
> this, the aforementioned user should be a domain user. You could possibly
> also impersonate a domain user with enough permissions before
instantiating
> and using the Excel object.
>
> --
> Sincerely,
> Dmitriy Lapshin [C# / .NET MVP]
> Bring the power of unit testing to the VS .NET IDE today!
> http://www.x-unity.net/tests...
>
> "KC" <chhatra@hotmail.com> wrote in message
> news:OAagClZpEHA.3324@TK2MSFTNGP15.phx.gbl...
> > Hi,
> > I have code similar to this..
> > Dim xlApp As Object
> > xlApp = CreateObject("Excel.Application", "\\MyServer")
> >
> > The call is from a asp.net (Intranet) application. \\Myserver is a
network
> > computer in the same domain as web server. The only way I can get this
> > call
> > worked is when I add the user who logs on to the web site as
> > Administrators.
> > I need to get this working without having to make the user
administrator.
> > Any suggestion?
> > Thanks,
> > CK
> >
> >
>