RE: Does the folder exist? by JLGWhiz
JLGWhiz
Sat Mar 15 14:16:00 CDT 2008
This is right out of VBA help file.
Sub ShowFolderList(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc
s = s & f1.name
s = s & vbCrLf
Next
MsgBox s
End Sub
If you don't want the whole list you could modifiy it to say:
For Each fl in fc
If fl.name = "ObjectFileName" Then
MsgBox "File Is There"
Else
MsgBox "Not In This Bunch"
End If
Next
"Otto Moehrbach" wrote:
> Excel XP & Win XP
> How can I determine if a specific folder, say "C:\The Folder", exists?
> I have an OP who will be sending some files, and the code to place the files
> in that folder, to some people. Thanks for your time. Otto
>
>
>