Be the first user to complete this post

  • 0
Add to List

FileSystemObject : MoveFile Method


This function moves a file from one location to another.

Format : 

objectOfFileSystemObject. MoveFile (source, destination);

  • objectOfFileSystemObject : As the name says, it’s a FileSystemObject.

As the name says, it’s a FileSystemObject.

  • source
    • Mandatory
    • Type:     String
    • Path of a file to be moved.

  • destination
    • Mandatory
    • Type:     String
    • Path where file to be moved.
Function FnMoveFile(strSourceFilePath,strDestinationPath)

      Set fso = CreateObject("Scripting.FileSystemObject")

      fso. MoveFile(strSourceFilePath, strDestinationPath)

End Function

Call FnMoveFolder ("c:\New Folder\text.txt",”d:\New Folder”)

Also Read:

  1. FileSystemObject : DeleteFile Method
  2. FileSystemObject : CreateTextFile Method
  3. Excel-VBA : Insert Multiple Images from a Folder to Excel Cells
  4. FileSystemObject in Excel Macro
  5. FileSystemObject : FolderExists Method
  6. FileSystemObject : CopyFolder Method
  7. FileSystemObject : GetDriveName Method