VBA - create a folder or check is exists

Post date: Feb 4, 2011 1:31:36 PM

Sub CornFlakes()

Dim FSOobj As Object

Set FSOobj = CreateObject("Scripting.FilesystemObject")

If FSOobj.FolderExists("C:\DsoFile\new folder") = False Then

FSOobj.CreateFolder "C:\DsoFile\new folder"

Else

MsgBox "Folder Exists"

End If

Set FSOobj = Nothing

End Sub