Overwrite existing CSV file using FSO Movefile

mrkipling

Registered User.
Local time
Today, 15:42
Joined
Mar 19, 2003
Messages
22
Im using this piece of code to move a csv file from one folder to another after processing. The problem is that if a csv file already exists with that name it does not overwrite this. can anyone sugges the easiest workaround for this.

'Move CSV File to chosen folder
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")

fs.MoveFile "C:\ftp\CSV\*.csv", "C:\processed"
Exit Sub

TIA

Mark
 
Hmz,

Why use the fs? at all?

Name
Kill
Mkdir
Remdir

Access commands nicely suited to do any file moving (but for FTP, which your doing beforehand... I would like to see the full code for FTP just for my sake if you dont mind)

If you dont want to use the access commands you can try storing the files in a "Dated" subfolder... Or "only" use the Kill command ...

Which ever you prefer....

Regards
 

Users who are viewing this thread

Back
Top Bottom