You can, but it's a little tricky.
http://www.kbalertz.com/kb_288366.aspx
-----Original Message-----
From: David Cramer [mailto:d_m_cramer@xxxxxxxxxxx]
Sent: Tuesday, December 14, 2004 10:54 AM
To: padnug@xxxxxxxxxxxxxxx
Subject: [padnug] Windows Service question
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 Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dpFolB/TM
--------------------------------------------------------------------~->
|