A Beginner method to check whether a file exists
A Beginner method to check whether the file exists or not. It is simple, easy to understand and should able to run on different Window OS.
AI
Resumen de IA: 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.
Código fuente
Public Function CheckFile(InFileName As String) As Boolean <br> On Error GoTo ErrHandler <br> CheckFile = False <br> 'Check whether the file or folder exist <br> If Dir(InFileName) <> "" Then <br> 'Check is it a directory(folder) <br> If (GetAttr(InFileName) And vbDirectory) = 0 Then <br> CheckFile = True <br> Else <br> MsgBox "File doesn't exist!", vbCritical <br> Exit Function <br> End If <br> Else <br> MsgBox "File doesn't exist!", vbCritical <br> Exit Function <br> End If <br> ErrHandler: <br> End Function
Comentarios originales (3)
Recuperado de Wayback Machine