List Applications That Are Running

  • Thread starter Thread starter Janie
  • Start date Start date
J

Janie

I know Application.Caption will tell me the name of a running app showing in
the Taskbar. What I need is the right For Each collection so I can get the
names of all running apps.

In theory, something like:

For Each App in Taskbar
Debug.Print App.caption
Next App

I know I have seem this somewhere and can't locate it.

Thanks
 
I'm not sure about VBA, but this is relatively simply using the Windows
Command Prompt (or command line as it's called).
Use the tasklist command (just type the word tasklist after the prompt) and
all running processes should be listed.
Default format is a table, but you can use
tasklist /fo list or
tasklist /fo csv
 
No, that is not going to help me as my routine later does something depending
on which applications are running. I must have something that is grounded in
VBA.

I have everything else in my module working fine -- I just need some way of
looping through the application names.

Anybody else got a good idea?
 
This requires Word to be installed (it does not have to be open)
'--
Sub WhichOnes()
Dim objWord As Object
Dim objTasks As Object
Dim N As Long
Set objWord = CreateObject("Word.Application")
Set objTasks = objWord.Tasks
For N = 1 To objTasks.Count
Cells(N, 2).Value = objTasks(N).Name
Next 'N
Set objTasks = Nothing
objWord.Quit
Set objWord = Nothing
End Sub
--
Jim Cone
Portland, Oregon USA




"Janie" <[email protected]>
wrote in message
I know Application.Caption will tell me the name of a running app showing in
the Taskbar. What I need is the right For Each collection so I can get the
names of all running apps.

In theory, something like:
For Each App in Taskbar
Debug.Print App.caption
Next App
I know I have seem this somewhere and can't locate it.
Thanks
 
Back
Top