Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Kill Excel Process

Could anyone provide ideas on how to kill an excel process? In our VB 6.0
app we populate data from MS Access to an MS Excel worksheet. If you look in
task manager you could see the excel processes running in the background.
Also, how could we identify which excel process to kill? Especially in the
case where a user is working on an ms excel worksheet and then generates one
from our app. We don't want to kill the one the user is working on. Only
the one we create from the app.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Kill Excel Process

Don't create another one, use the one that is there if there is one. If you
create anew, then kill it.

Something along the lines of

Dim xlApp As Object
Dim fCreated As Boolea n

On Error Resum Next
Set xlApp = GetObject(,"Excel.Application")
If xlApp Is Nothing Then
Set xlApp = CreatObject("Excel.Application")
If xlApp Is Nothin g Then
Exit Sub
Else
fCreated = True
End If
End If

'do your stuff

If fCreated Then
xlApp.Quit
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike Moore" wrote in message
...
Could anyone provide ideas on how to kill an excel process? In our VB 6.0
app we populate data from MS Access to an MS Excel worksheet. If you look

in
task manager you could see the excel processes running in the background.
Also, how could we identify which excel process to kill? Especially in

the
case where a user is working on an ms excel worksheet and then generates

one
from our app. We don't want to kill the one the user is working on. Only
the one we create from the app.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Kill Excel Process

The other thing I should have said is that if you create an application
object for the Excel App that you create, you can just quit that

xlApp.Quit

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike Moore" wrote in message
...
Could anyone provide ideas on how to kill an excel process? In our VB 6.0
app we populate data from MS Access to an MS Excel worksheet. If you look

in
task manager you could see the excel processes running in the background.
Also, how could we identify which excel process to kill? Especially in

the
case where a user is working on an ms excel worksheet and then generates

one
from our app. We don't want to kill the one the user is working on. Only
the one we create from the app.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Kill Excel Process

Hi RP

That depends on how well written the code is. If Excel asks to save changes
or not, or something else that she may ask on quit, then it needs user
interaction. And if xlApp.Visible = True is not part of the show, then the
question will remain invisible and unanswered and the process will not be
terminated.

Best wishes Harald

"Bob Phillips" skrev i melding
...
The other thing I should have said is that if you create an application
object for the Excel App that you create, you can just quit that

xlApp.Quit

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike Moore" wrote in message
...
Could anyone provide ideas on how to kill an excel process? In our VB

6.0
app we populate data from MS Access to an MS Excel worksheet. If you

look
in
task manager you could see the excel processes running in the

background.
Also, how could we identify which excel process to kill? Especially in

the
case where a user is working on an ms excel worksheet and then generates

one
from our app. We don't want to kill the one the user is working on.

Only
the one we create from the app.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Kill Excel Process

Hi Harald,

Bob's the name :-).

I have also seen mentioned, though not experienced it myself, that having
the app visible sometimes leads to the Quit not working (this may be in a
..Net environment now that I say it). The suggestion here was to make not
visible before the quit.

Bob


"Harald Staff" wrote in message
...
Hi RP

That depends on how well written the code is. If Excel asks to save

changes
or not, or something else that she may ask on quit, then it needs user
interaction. And if xlApp.Visible = True is not part of the show, then the
question will remain invisible and unanswered and the process will not be
terminated.

Best wishes Harald

"Bob Phillips" skrev i melding
...
The other thing I should have said is that if you create an application
object for the Excel App that you create, you can just quit that

xlApp.Quit

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike Moore" wrote in message
...
Could anyone provide ideas on how to kill an excel process? In our VB

6.0
app we populate data from MS Access to an MS Excel worksheet. If you

look
in
task manager you could see the excel processes running in the

background.
Also, how could we identify which excel process to kill? Especially

in
the
case where a user is working on an ms excel worksheet and then

generates
one
from our app. We don't want to kill the one the user is working on.

Only
the one we create from the app.









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Kill Excel Process


"Mike Moore" wrote in message
...
Could anyone provide ideas on how to kill an excel process? In our VB 6.0
app we populate data from MS Access to an MS Excel worksheet. If you look

in
task manager you could see the excel processes running in the background.
Also, how could we identify which excel process to kill? Especially in

the
case where a user is working on an ms excel worksheet and then generates

one
from our app. We don't want to kill the one the user is working on. Only
the one we create from the app.


http://support.microsoft.com/kb/132535/EN-US/

/Fredrik



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to count process running time ( process not finished) miao jie Excel Programming 2 January 12th 05 06:01 AM
How to Kill Excel application process HoGo Excel Programming 2 December 13th 04 10:53 AM
Quit Method do not kill excel process Rui Oliveira Excel Programming 2 January 16th 04 09:38 AM
Quit Method do not kill excel process Rui Oliveira Excel Programming 0 January 15th 04 04:51 PM
to kill a excel process han keat Excel Programming 1 July 18th 03 07:32 AM


All times are GMT +1. The time now is 07:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"