Delete Files in Excel Visual Basic?

  Desert Andy 10:10 25 Mar 05
Locked

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?

Thanks

  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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

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

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…