A Beginner method to check whether a file exists
A Beginner method to check whether the file exists or not. Simple and should able to run on different Window OS.
AI
Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Codice sorgente
Public Function CheckFile(InFileName As String) As Boolean <br>
On Error GoTo ErrHandler <br>
CheckFile = False <br>
If Dir(InFileName) <> "" Then <br>
If (GetAttr(InFileName) And vbDirectory) = 0 Then <br>
CheckFile = True <br>
Else <br>
MsgBox "File doesn't exist!", vbCritical <br>
Exit Sub <br>
End If <br>
Else <br>
MsgBox "File doesn't exist!", vbCritical <br>
Exit Sub <br>
End If <br>
ErrHandler: <br>
End Function
Commenti originali (3)
Recuperato da Wayback Machine