You might like to try the following function.
Note that a path with trailing "\" (eg. "c:\windows\") returns false by
design.
Regards
Barry Evans
'====================================
Public Function DirExists(PathName As String) As Boolean
On Error GoTo DirExists_Exit
Dim Result As Boolean ' Default function result = False
Dim strDir As String
strDir = Dir(PathName, vbDirectory)
If strDir <> vbNullString Then ' could use "Len(strDir) > 0"
If Left(strDir, 1) <> "." Then
Result = (GetAttr(PathName) And vbDirectory) = vbDirectory
End If
End If
DirExists_Exit:
DirExists = Result
End Function
'====================================
Quote:
>Hello,
>How can you find out if a specific path exists or not?
>(I don't need to find out if a file belongs to that path, only if the path
>exists)
>If it doens't exist I want to create it.
>The Dir function causes an error 76 (Path doesn't exist!). I can catch that
>error (On Error Goto ...), but isn't there a more elegant method?
>Laurent Meurisse
>GOODYEAR Fabric Plant Luxembourg