logo       

Re: Windows Service question: msg#00076

Subject: Re: Windows Service question

While I agree with DG below (use ADO.NET on top of Excel), you may 
also want to take a look at the Office Primary Interoperability 
Assemblies.  I did some Word interaction work for the spell checking 
functionality.  You can download the code at 
http://www.windowsforms.net/articles/spellcheck.aspx.  There are 
other Office Interop articles available there as well.


--- In padnug@xxxxxxxxxxxxxxx, "dbg4870" <dbg4870@xxxx> wrote:
> 
> Well, perhaps you misunderstood my suggestion. What I mean is that 
> can still use an Excel spreadsheet, but you don't necessarily have 
to 
> use automation to manipulate it. You can update the spreadsheet 
file 
> by treating it as a datasource and using ADO.NET. Anyways...Good 
Luck!
> 
> - DG
> 
> --- In padnug@xxxxxxxxxxxxxxx, "David Cramer" <d_m_cramer@xxxx> 
wrote:
> > Unfortunately, yes, I must use Excel as per my customers 
request. 
> We are use 
> > ADO.NET for most of this application, but this component must be 
in 
> Excel.
> > 
> > D
> > 
> > >From: "dbg4870" <dbg4870@xxxx>
> > >Reply-To: padnug@xxxxxxxxxxxxxxx
> > >To: padnug@xxxxxxxxxxxxxxx
> > >Subject: [padnug] Re: Windows Service question
> > >Date: Wed, 15 Dec 2004 01:54:02 -0000
> > >
> > >
> > >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 --------------------~--> 
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
--------------------------------------------------------------------~-> 

 


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