The FileSystemObject VBA CreateFolder method creates a new folder. An error will be raised if folder Exists. Use the VBA FolderExists method to check if folder exists.
VBA FileSystemObject Methods
- BuildPath
- CopyFile
- CopyFolder
- CreateFolder
- CreateTextFile
- DeleteFile
- DeleteFolder
- DriveExists
- FileExists
- FolderExists
- GetAbsolutePathName
- GetBaseName
- GetDrive
- GetDriveName
- GetExtensionName
- GetFile
- GetFileName
- GetFolder
- GetParentFolderName
- GetSpecialFolder
- GetTempName
- MoveFile
- MoveFolder
- OpenTextFile
VBA CreateFolder Syntax
fso.CreateFolder( foldername )
foldername
Name of the folder to be created.
VBA CreateFolder Examples
Set fso = CreateObject("Scripting.FileSystemObject") 'Create NewFolder fso.CreateFolder "C:\Src\NewFolder"