Check that path exists.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

in my code below a is a path to a remote server. How can I test if the path
exists;

i.e if a something then....

Bruce

Private Sub copyDB()

Set fs = CreateObject("Scripting.FileSystemObject")

myDest = Array("\\myServer\myShare\myFolder\")

For Each a In myDest
If a not exist then
Msgbox(“Path not Foundâ€)
End
End if
Next a
End Sub
 
If you are working in Access:

Public Function FolderExists(varPath As Variant) As Boolean
On Error Resume Next
If Len(varPath) > 0& Then
FolderExists = (Len(Dir$(varPath, vbDirectory)) > 0&)
End If
End Function
 
Back
Top