verify a path exists
I do this:
Dim TestStr as string
teststr = ""
on error resume next
teststr = dir("c:\windows\media\nul")
on error goto 0
if teststr = "" then
'doesn't exist
else
'it's there
end if
====
But this'll work, too:
If CreateObject("Scripting.FileSystemobject") _
.folderexists("C:\windows\media") = True Then
MsgBox "Yep"
Else
MsgBox "nope"
End If
JLGWhiz wrote:
This is probably so simple that I am overlooking it. I want to write code as
an If...Then method to verify that a certain path exists. Let's say
"C:\Windows|Media".
I tried the Exists( What ) method but could not find an object that VBA
liked. Make me feel stupid and show me the code. Thanks.
--
Dave Peterson
|