Delete Files in Excel Visual Basic?

  Desert Andy 10:10 25 Mar 05

I have written the following code to back up data from one folder to another.
Set fs = CreateObject("Scripting.FileSystemObject")
fs.copyfolder "c:\79 Operations Folder", "c:\Operations Back Up\Back Up 1\79 Operations Folder"
It seems to work 90% of the time, however, occassionally i have problems with it since it says I can't read the files. If I delete the old files first, it works fine. Is there a way to delete the files in the '79 Operations Folder' before i copy across back up files using visual basic in Excel?


  VoG II 10:14 25 Mar 05

The command is

Kill <filename>

where <filename> is the full path to the file.

This thread is now locked and can not be replied to.

Samsung Galaxy S8 review

1995-2015: How technology has changed the world in 20 years

This poetic animation about monsters is illustrated in a Van Gogh painterly style

Apple predictions 2017