Be the first user to complete this post

  • 0
Add to List

FileSystemObject : CopyFolder Method

Description: 

This function copies a Folder from one location to another.

Format : 

objectOfFileSystemObject. CopyFolder (source, destination[, overwrite] );

Arguments: 
  • objectOfFileSystemObject
    • As the names says, it’s a FileSystemObject.
  • source
    • Mandatory
    • Type:     String
    • Path of a folder to be copied.
  • destination
    • Mandatory
    • Type:     String
    • Path where folder to be copied.
  • overwrite
    • Optional
    • Type: Boolean ( True(default): if existing folder to be overwritten, False: if not overwritten)
Function FnCopyFolder(strSourcePath,strDestinationPath)       
   Set fso = CreateObject("Scripting.FileSystemObject")     
  Set objFolder = fso. CopyFolder(strSourcePath, strDestinationPath)
End Function



Also Read:

  1. FileSystemObject : GetDriveName Method
  2. FileSystemObject : CreateTextFile Method
  3. FileSystemObject : MoveFolder Method
  4. FileSystemObject : FolderExists Method
  5. VBA-Excel: Add/Insert multiple objects from a folder in an Excel Document.