Hello,

This is my code to open my program from excel;

Public Sub OpenPLaunchShell()
On Error GoTo Err_PLaunch

Dim strappPack As String
Dim BoPack As Boolean


On Error Resume Next

strappPack = "C:\Program Files\PLaunch\PLaunch.exe"



If Err <> 0 Then


BoPack = True ' if no error PLaunch is open
Err.Clear
MsgBox "PLaunch is not open"
Call Shell(strappPack, 2)
AppActivate strappPack
Exit Sub

Else
Exit Sub
MsgBox "Found PLaunch open"
End If

'Exit from the code
ExitCode:
Exit Sub

'Error Handler
Err_PLaunch:
MsgBox Err.Description
Resume ExitCode


End Sub


This is the sub to close my program; but the problem is that I close
the visual studio when I try to execute this code:


Sub ClosePLaunch()


Dim strappPack As String

strappPack = "C:\Program Files\PLaunch\PLaunch.exe"


'Close PLaunch
SendKeys "%{F4}", True
DoEvents

End Sub

Someone has any suggestion how to close an application on sending the
Alt+F4 key.

Ina