Option Explicit 'ShellExecute Lance un programme a partir de l'extention de fichier Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Const SW_SHOWNORMAL = 1 Private Sub Form_Load() 'Me.hwnd = Le handle de la feuille 'lpOperation = "Open" 'lpFile = Chemin du fichier a lancer 'lpParameters = vbNullString 'lpDirectory = "C:" 'nShowCmd = Etat de la fenetre (SW_SHOWNORMAL) 'Ne pas oublier l'extention "EXE" et le chemin exact de ton exe ShellExecute Me.hwnd, "Open", _ "C:\Mes documents\spptotxt.EXE", _ vbNullString, "C:", SW_SHOWNORMAL Unload Me End End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question