logo       

Re: Windows Service question: msg#00071

Subject: Re: Windows Service question

Are you sure you need to "start and stop Excel"? Perhaps you can 
accomplish whatever it is you are doing that for by using the 
spreadsheet as a datasource and using ADO.NET?

- DG

--- In padnug@xxxxxxxxxxxxxxx, "David Cramer" <d_m_cramer@xxxx> wrote:
> Hi,
> 
> I am fairly new to dotnet and windows services so I apologize if 
this is 
> something you all have already discussed.
> 
> I need to start and stop Excel from a windows service. My service 
is working 
> just fine reading/writing files and other basic tasks. However, 
when the 
> excel application is created, my service tries to install Excel 
when it is 
> run as "LocalSystem". When I run it as a user with administrative 
privileges 
> an error is returned (the error says that no error was returned but 
an error 
> occurred). I am using C#, .NET 1.1 on windows 2000.
> 
> protected override void OnStart(string[] args)
> {
>        Excel.Application xl = new Excel.Application (); // code 
stops here, 
> excel application never created
>        // do something, exit excel, clean up
>        ...
> }
> 
> Is it not possible to start Excel from a Windows Service? I have 
tried 
> everything I can think of on the adminstration side, now I am 
trying to 
> solve this programmatically. I have this same code in another 
application 
> and it works just fine. The UI doesn't come up and isn't needed. 
Has anyone 
> encountered this problem or have any suggestions?
> 
> Thanks





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/dpFolB/TM
--------------------------------------------------------------------~-> 

 


<Prev in Thread] Current Thread [Next in Thread>