I
ina
Hello,
I have this sub that alows me to open the program PackLaunch from
Excel. The problem is that I have only one license of this program and
I need to open it only one time. if the program is already open I need
to exit from this sub. the problem is that the sub executes the if
twice and I do not know why.
Public Sub OpenPLaunch()
Dim appPack As String
Dim BoPack As Boolean
On Error Resume Next
appPack = "C:\Program Files\PLaunch\PLaunch.exe"
Shell appPack
If Err <> 0 Then
BoPack = True ' if no error PLauch is open
Err.Clear
MsgBox "PLaunch is not open"
appPack = "C:\Program Files\PLaunch\PLaunch.exe"
Shell appPack
Exit if
Else
MsgBox "found PLauch open"
Exit Sub
End If
End Sub
Any help is kindly appreciated
Ina
I have this sub that alows me to open the program PackLaunch from
Excel. The problem is that I have only one license of this program and
I need to open it only one time. if the program is already open I need
to exit from this sub. the problem is that the sub executes the if
twice and I do not know why.
Public Sub OpenPLaunch()
Dim appPack As String
Dim BoPack As Boolean
On Error Resume Next
appPack = "C:\Program Files\PLaunch\PLaunch.exe"
Shell appPack
If Err <> 0 Then
BoPack = True ' if no error PLauch is open
Err.Clear
MsgBox "PLaunch is not open"
appPack = "C:\Program Files\PLaunch\PLaunch.exe"
Shell appPack
Exit if
Else
MsgBox "found PLauch open"
Exit Sub
End If
End Sub
Any help is kindly appreciated
Ina