Hello and I need your help again please!!
I used following code to moving file from one location to other and working just fine so far.
Problem now is if some how either source or destination has same file, then code is stop running and message show file already existing.
I'm thinking just overwrite file or given user choice.
Is there anyone can help me on this?
Your help is greatly appreciated.
Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile = "C:\Data\*.*"
sDestinationFile = "C:\Data2\"
oFSO.MoveFile sSourceFile, sDestinationFile
' Clean Up
Set oFSO = Nothing
End Sub
I used following code to moving file from one location to other and working just fine so far.
Problem now is if some how either source or destination has same file, then code is stop running and message show file already existing.
I'm thinking just overwrite file or given user choice.
Is there anyone can help me on this?
Your help is greatly appreciated.
Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile = "C:\Data\*.*"
sDestinationFile = "C:\Data2\"
oFSO.MoveFile sSourceFile, sDestinationFile
' Clean Up
Set oFSO = Nothing
End Sub