Creates a folder.
Syntax
object.CreateFolder (foldername)
The CreateFolder method has these parts:
Part | Description |
---|---|
object | Required. Always the name of a FileSystemObject. |
foldername | Required. String expression that identifies the folder to create. |
Remarks
An error occurs if the specified folder already exists.
Examples
The following code illustrates the use of the CreateFolder method.
Sub CreateFolderDemo()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a new folder: TEST
fso.CreateFolder "D:\Temp\TEST"
End Sub