Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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, |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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, |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check register running balance to another worksheet | Excel Worksheet Functions | |||
Check if Conditional Format is True or False / Check cell Color | Excel Worksheet Functions | |||
Clearing Check Boxes & Running a diff Macro when unchecking the ch | Excel Discussion (Misc queries) | |||
how : check register running balance is a stationary cell | Excel Discussion (Misc queries) | |||
Check for Excel version before running? | Excel Programming |