Copying a File : FileSystemObject « File Path « VBA / Excel / Access / Word






Copying a File

 
Sub Copy_AnyFile()
   Dim fs As Object
   Dim strDb As String

   Set fs = CreateObject("Scripting.FileSystemObject")
   strDb = "C:\NewAccessDb.mdb"
   fs.CopyFile strDb, CurrentProject.Path & "\"
   Set fs = Nothing
End Sub

 








Related examples in the same category

1.Display selected file information
2.Delete file by using FileSystemObject
3.Delete Folder by using FileSystemObject
4.Recursive Search using the FileSystemObject Model
5.Listing files with a For...Each loop