Validate the file path : Dir « Forms « VBA / Excel / Access / Word






Validate the file path

 
Function ValidPath() As Boolean
    Dim fPath As String
    fPath = "c:\"
    If Dir(fPath, vbDirectory) = "" Or fPath = "" Then
        ValidPath = False
    Else
        ValidPath = True
    End If
End Function

 








Related examples in the same category

1.Dir() Returns a string representing the name of a file or directory with specified pattern.
2.Use Dir function to get the file directory
3.Get Directory by using the Dir function
4.Get the file names