ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   List Applications That Are Running (https://www.excelbanter.com/excel-programming/430971-list-applications-running.html)

Janie

List Applications That Are Running
 
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


arjen van...

List Applications That Are Running
 
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

Janie

List Applications That Are Running
 

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?


"arjen van..." wrote:

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


Jim Cone[_2_]

List Applications That Are Running
 
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"
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



All times are GMT +1. The time now is 02:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com