Question : vba check if file exists
Answered by : daniel-ferry
Public Function IsFile(s) IsFile = CreateObject("Scripting.FileSystemObject").FileExists(s)
End Function
Source : https://stackoverflow.com/questions/16351249/vba-check-if-file-exists/61005178#61005178 | Last Update : Fri, 10 Apr 20
Question : excel vba existence of a file
Answered by : vastemonde
' Existence of a file
If Dir("C:\myDirectory\myFile", vbDirectory) = vbNullString Then MsgBox "Doesn't exists"
Else MsgBox "Exists"
End If
Source : | Last Update : Thu, 21 Jan 21
Question : vba file exists
Answered by : robert-dorrigan
Sub test()
thesentence = InputBox("Type the filename with full extension", "Raw Data File")
Range("A1").Value = thesentence
If Dir(thesentence) <> "" Then MsgBox "File exists."
Else MsgBox "File doesn't exist."
End If
End Sub
Source : https://stackoverflow.com/questions/11573914/check-if-the-file-exists-using-vba | Last Update : Mon, 27 Jun 22