1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| nomfich = App.Path & "\à traiter\" & dateref & "" & agence & ".xls"
If nomfich <> "" Then
Set exapp = Nothing
Set exapp = CreateObject("excel.application")
'ouverture des fichiers sous excel
exapp.Workbooks.Open (nomfich)
'exapp.Workbooks.OpenText FileName:=App.Path & "\" & agence & "\" &
Set exwrk = exapp.ActiveWorkbook
Set exsht = exwrk.ActiveSheet
'reinitialisation erreur
erreur = False
'requete si erreur
ExceptionErreur:
exapp.quit
msgbox "Aucun fichier correspondant dans le dossier",vbInformation,"Erreur" |
Partager