Tester l'existence d'un fichier
- Code : Tout sélectionner
Function IsValideFile(wPathFile As String) As Integer
'détect si un fichier existe
On Error Goto ErreurIsValideFile
If Trim(wPathFile) = "" Then
IsValideFile = False
Exit Function
End If
If Trim(Dir$(wPathFile,0)) = "" Then
IsValideFile = False
Else
IsValideFile = Isnumeric(Filelen(wPathFile))
End If
Exit Function
ErreurIsValideFile:
' Msgbox "(IsValideFile) Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
IsValideFile = False
Exit Function
End Function