M
Mike
Hello,
Is there a simple way to find if a sub directory exists or
not.
Thanks
Is there a simple way to find if a sub directory exists or
not.
Thanks
-----Original Message-----
Tom,
Yes you're quite right...
Here's the ammended code:
Sub test()
Const cDir = "C:\", cSubDir = "WINDOWS"
Dim strTemp As String
strTemp = Dir(cDir, vbDirectory)
Do Until strTemp = ""
If LCase(strTemp) = LCase(cSubDir) Then
If (GetAttr(cDir & Application.PathSeparator & strTemp) And
vbDirectory) = vbDirectory Then Exit Do
End If
strTemp = Dir
Loop
If LCase(strTemp) = LCase(cSubDir) Then
MsgBox "SubDir Found"
Else
MsgBox "SubDir Not Found"
End If
End Sub
--
Rob van Gelder - http://www.vangelder.co.nz/excel
.