Bonsoir ChTi160, FaridP
Comme on neutralise l'erreur sur l'ouverture du fichier on n'a pas de retour d'information.
Ci dessous un morceau de code qui permet de vérifier si le fichier est ouvert.
' vérification fichier ouvert
trouve = 1
For i = 1 To Workbooks.Count
If Workbooks(i).Name = 'Export.xls' Then
trouve = 0' nom à remplacer en fonction de l'application
Exit For
End If
Next i
If trouve = 1 Then
title1 = ' Ouverture fichier'
Msg = ' Fichier Export.xls non trouvé '
Style = vbOKCancel + vbCritical + vbDefaultButton2
' Affiche le message pour validation.
Reponse2 = MsgBox(Msg, Style, title1)
If Reponse2 = vbCancel Then Exit Sub
End If
Bon W. E.
Message édité par: jp14, à: 20/03/2006 12:24