Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validate folder path 1

Status
Not open for further replies.

kliz0328

Programmer
Nov 7, 2005
138
US
I was wondering how to check and see if a folder path is valid or not? Is there some kind of IsValidPath function?
 
Try something like:

Private Sub Form_Open(Cancel As Integer)

If Dir("C:\Program Files\Something", vbDirectory) = "" Then
MsgBox "Folder does not exist"
Else
MsgBox "Folder Exist"

End If

End Sub

Or you could try using:
Set fso = CreateObject("Scripting.FileSystemObject")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top