excel vba‎ > ‎

VBA - create a folder or check is exists

posted Feb 4, 2011, 5:31 AM by Roberto Felicini
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
Comments