Jugulator
8/12/2018 - 12:41 PM

File Exists

Public Function FileExists(byVal PathString As String) As Boolean
'Description: checks if a file exists
'Inputs:      path and name of file (string)
'Outputs:     TRUE/FALSE

    Dim obj_fso As Object
    Set obj_fso = CreateObject("Scripting.FileSystemObject")
    FileExists = obj_fso.FileExists(PathString)

End Function

Public Function FileExists(byVal PathString As String) As Boolean
'Description: checks if a file exists
'Inputs:      path and name of file (string)
'Outputs:     TRUE/FALSE
'Note:        gives TRUE if PathString = vbNullString

    FileExists = IIf(Dir$(PathAndFilename) = vbNullString, False, True)

End Function