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 check if directory exists
Answered by : daniel-ferry
Public Function IsDir(s) IsDir = CreateObject("Scripting.FileSystemObject").FolderExists(s)
End Function
Source : http://academy.excelhero.com/ | Last Update : Fri, 10 Apr 20
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