Check that path exists.

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
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top