Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default 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" wrote in message
...
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
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
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Checking and IF ? mohamadhafiz Excel Worksheet Functions 5 June 26th 07 11:04 PM
Checking to see that a CHART exists prior to running a simple command Anton Excel Discussion (Misc queries) 0 August 29th 06 06:30 AM
Add checking Pat Excel Worksheet Functions 5 December 17th 04 08:25 PM
Vba - Checking if running ajliaks[_39_] Excel Programming 2 September 11th 04 06:09 PM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"