![]() |
check for running app
Is there a way to check for a running program on a computer in vba and
if it isn't, start the program. Ex. Program to check for is domywork.exe It is found in c:\MyStuff\domywork.exe |
check for running app
Here is an example using Word
Dim wdApp As Object On Error Resum Next Set wdApp = GetObject("Word.Application") On Error Goto 0 If wdApp Is Nothintg Then Set mwdApp = CreateObject("Word.Application") End If -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "L3Tech" wrote in message ... Is there a way to check for a running program on a computer in vba and if it isn't, start the program. Ex. Program to check for is domywork.exe It is found in c:\MyStuff\domywork.exe |
check for running app
If not COM, you could try
AppActivate ("myapp") where myapp is as shown in the Task Manager, -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Bob Phillips" wrote in message ... Here is an example using Word Dim wdApp As Object On Error Resum Next Set wdApp = GetObject("Word.Application") On Error Goto 0 If wdApp Is Nothintg Then Set mwdApp = CreateObject("Word.Application") End If -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "L3Tech" wrote in message ... Is there a way to check for a running program on a computer in vba and if it isn't, start the program. Ex. Program to check for is domywork.exe It is found in c:\MyStuff\domywork.exe |
check for running app
I don't know if I am understanding your reply.
While my code runs, I need to check to see if an external program is running on the computer. If it is not, then I need to start that program. The program is not a microsoft program. Bob Phillips wrote: If not COM, you could try AppActivate ("myapp") where myapp is as shown in the Task Manager, |
check for running app
If it is not COM (let's assume it is not) then test as I showed, and if not
there then Shell it. Here is an example using the Calculator program On Error Resume Next AppActivate "Calculator" If Err.Number < 0 Then Shell "C:\Windows\system32\calc.exe" End If You will know the path and app name for Shell, you can check the app by starting it and see what is in Task Manager. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "L3Tech" wrote in message ... I don't know if I am understanding your reply. While my code runs, I need to check to see if an external program is running on the computer. If it is not, then I need to start that program. The program is not a microsoft program. Bob Phillips wrote: If not COM, you could try AppActivate ("myapp") where myapp is as shown in the Task Manager, |
check for running app
Thanks
I got it to work. For my info, what is COM? I am using excel 97. Is this something new? Bob Phillips wrote: If it is not COM (let's assume it is not) then test as I showed, and if not there then Shell it. Here is an example using the Calculator program On Error Resume Next AppActivate "Calculator" If Err.Number < 0 Then Shell "C:\Windows\system32\calc.exe" End If You will know the path and app name for Shell, you can check the app by starting it and see what is in Task Manager. |
check for running app
COM is another, older, term for Automation, which is probably MS's
preferred terminology these days. It's a technology supported by Visual Basic and the Microsoft Office applications that enables one application to work with another application's objects. So an Excel app can create/read/write a Word document. The most common example you might see here is Excel sending mail via Outlook using COM/Automation . It was around with 97, and is still with us in 2003. It is an MS technology, but there are other vendors that support COM/Automation as well, as it allows them to use the MS apps and not have to write that function themselves. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "L3Tech" wrote in message ... Thanks I got it to work. For my info, what is COM? I am using excel 97. Is this something new? Bob Phillips wrote: If it is not COM (let's assume it is not) then test as I showed, and if not there then Shell it. Here is an example using the Calculator program On Error Resume Next AppActivate "Calculator" If Err.Number < 0 Then Shell "C:\Windows\system32\calc.exe" End If You will know the path and app name for Shell, you can check the app by starting it and see what is in Task Manager. |
All times are GMT +1. The time now is 02:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com