• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 75
  • Last Modified:

MOVE FILE

I would like to move a file from one location to another,overwrite the file if it's exists in the new location and inform the user if the transfer was successful.
Thanks
0
Svgmassive
Asked:
Svgmassive
1 Solution
 
rindiCommented:
What OS? and what does this have to do with m$ Access?
0
 
Rey Obrero (Capricorn1)Commented:
try ths codes


Sub MoveFile()
Dim sFile As String, sPath As String, sDest As String
sPath = "C:\Users\xxx\OldFolder\"
sFile = "myExcel.xlsx"
sDest = "C:\Users\xxx\NewFolder\"
If Dir(sDest & sFile) <> "" Then
    Kill sDest & sFile
End If
   
Name sPath & sFile As sDest & sFile

If Dir(sDest & sFile) <> "" Then
    MsgBox "File moved"
End If

End Sub
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now