+ Reply to Thread
Results 1 to 9 of 9

Kill a Process

  1. #1
    Registered User
    Join Date
    10-02-2017
    Location
    Huntsville, Alabama
    MS-Off Ver
    2010
    Posts
    33

    Kill a Process

    So..ok, I started a program with the shell command which returns the process ID number. How do you close the process using that ID number?

    TIA
    Grug

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    3,581

    Re: Kill a Process

    Hi this was posted at stackoverflow:
    https://stackoverflow.com/questions/...rough-vba-code
    Maybe it can help you
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    10-02-2017
    Location
    Huntsville, Alabama
    MS-Off Ver
    2010
    Posts
    33

    Re: Kill a Process

    I do wonder from the two examples if they are Windoze version specific or subject to change, but I'm guessing the process ID number returned is of no use to VBA then?

    I think what you found is great starting point however --- thanks @Keebellah

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    3,581

    Re: Kill a Process

    The command to kill is the following:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-02-2017
    Location
    Huntsville, Alabama
    MS-Off Ver
    2010
    Posts
    33

    Re: Kill a Process

    VBA help (F1):

    Please Login or Register  to view this content.
    It seems odd Excel VBA returns a process ID from the shell command and it isn't used (by VBA). However, I've never considered Excel (or anything else under the micro$oft name) to be a finished product...

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    3,581

    Re: Kill a Process

    What makes you say that? What process ID? IS it active?
    Have you checked under de dos command prompt?
    You're using one application to do something entirely different that what it's intended for.
    Finished product?
    IS your family car not an unfinished product because you cannot make it plow a cornfield?

  7. #7
    Registered User
    Join Date
    10-02-2017
    Location
    Huntsville, Alabama
    MS-Off Ver
    2010
    Posts
    33

    Re: Kill a Process

    Well, like I said, your previous solution looked entirely workable

    You're using one application to do something entirely different that what it's intended for.
    This is arguable, but also an "in the eye of the beholder" thing. At face value, lets just say that if you can show me a native VBA command using the returned value of the shell command (other than non-zero which could have been implemented by micro$oft as a Boolean return value), and I'll concede I've made my previous "assertion" under false premise?

    Thanks again,
    Grug

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2016
    Posts
    3,581

    Re: Kill a Process

    Hi Grug,
    Playing around a little, this code will retrieve the running tasks and list them in a file named PROCESSES.txt in your temp folder
    Please Login or Register  to view this content.
    You can use the output in for example a listbox to select the task you want to kill.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2013 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    21,109

    Re: Kill a Process

    This thread has been marked as solved, but also reported as having gone off topic.

    Steve - if there is something further you wish to know that hasn't been addressed by Keebellah, then please state it clearly here so that someone else can take a look and advise. I confess from reading the thread, I am not sure what that is, so you will need to provide clarification if you need further help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    STOP PRESS: Forum Rules Updated September 2018! Please read them here.
    If anyone has helped you towards solving a problem, then you can thank them by clicking on their reputation star bottom left.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1