Je fais moi aussi un shell pour lancer DTSRUN (mais depuis du VBA)... comment fais tu pour intercepter les erreurs éventuelles pendant l'exécution du DtsRun ?
Merci de ta réponse
Tiens j'ai un code super vieux, genre 1998, qui te permet de faire ça... je ne l'ai pas retester depuis, mais ça marchait bien...
Declare Function OpenProcess Lib "Kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function GetExitCodeProcess Lib "Kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
Public Sub gExecuteAppAndWait(ByVal sApplicationPathExe As String)
Dim hProcess As Long
Dim RetVal As Long
If Len(sApplicationPathExe) = 0 Then Exit Sub
'On capture le process ID de l'exe et on attend
On Error GoTo RunError:
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(sApplicationPathExe, vbNormalFocus))
Do
'Obtient le statut du process
GetExitCodeProcess hProcess, RetVal
'petite pause pour laisser windows gérer les autres évenements
DoEvents: Sleep 50
'Loop jusqu'à ce que le process statut ne soit plus actif
Loop While RetVal = STILL_ACTIVE
Je fais moi aussi un shell pour lancer DTSRUN (mais depuis du VBA)... comment fais tu pour intercepter les erreurs éventuelles pendant l'exécution du DtsRun ?
Merci de ta réponse