+ Reply to Thread
Results 1 to 2 of 2

checking for a running app

  1. #1
    L3Tech
    Guest

    checking for a running app

    Is there a way from within an excel macro to check if a program is
    running on the computer. I need to check to see if a program is running
    (which is not a microsoft program) before I execute some code.


  2. #2
    Steve Yandl
    Guest

    Re: checking for a running app

    If you know that Excel will be running on a WinXP, Win2k, or some other PC
    with WMI installed, you could use WMI to get a list of running processes and
    check for the one of interest.

    A better solution might be to use Word. Most of the time, a user running
    Excel also has Word installed on the same PC. The Word application has a
    tasks collection that will let you check for processes that have their own
    window. It uses the friendly name that would typically be in the title bar
    of the application. For example, I could run this from Excel to check if
    the game solitaire was running on the PC.

    Sub CheckApps()
    Set objWord = CreateObject("Word.Application")
    Set colTasks = objWord.Tasks
    If colTasks.Exists("Solitaire") Then
    MsgBox "Someone is playing solitaire"
    End If
    objWord.Quit
    End Sub

    Steve



    "L3Tech" <[email protected]> wrote in message
    news:[email protected]...
    > Is there a way from within an excel macro to check if a program is running
    > on the computer. I need to check to see if a program is running (which is
    > not a microsoft program) before I execute some code.
    >




+ 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