Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to check to see if file is open before opening

Status
Not open for further replies.

johnnyplang

Programmer
Apr 26, 2006
9
0
0
US
Everytime I press the active x control to run program.exe file a new window opens instead of placing the original window on top. The below statements don't work.

If hwnd <> 0 Then
AppActivate "program X"
Else
Shell ("c:\Program X.exe")
End If
 
oops forgot the first line

hwnd = FindWindow(vbNullString, "program X")
If hwnd <> 0 Then
AppActivate "program X"
Else
Shell ("c:\Program X.exe")
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top