File Exists

This function will return True if the file exists and False if the file does not exist

Private Function FileExists(sFileName) As Boolean 
Dim sreturn As String
   sret = Dir(sFileName)
   If Len(sreturn) > 0 Then
      FileExists = True
   Else
      FileExists = False
   End If
End Function

Function File_Exists(filename As String) As Boolean 
Dim fso As New Scripting.FileSystemObject
   File_Exists = fso.FileExists(filename)
   Set fso = Nothing
End Function


© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext