Public Function IsFileExist(ByVal strFileName As String) As Boolean
'Determines if a file exists Dim fs As Object If InStr(strFileName, "*") = 0 And InStr(strFileName, "?") = 0 Then Set fs = CreateObject("Scripting.FileSystemObject") IsFileExist = fs.FileExists(strFileName) Set fs = Nothing Else IsFileExist = Not (Dir(strFileName) = "") End If End Function |