How to delete file

D

dominicb

Good morning Kizzie

Use this:

Kill "C:\Thisfile.xls"

Please note that this will not send the file to the recycle bin (this
can't be done without resorting to Windows API calls) but will
completely delete it.

HTH

DominicB
 
A

Amedee Van Gasse

In <[email protected]>, kizzie told
us an interesting story. My reply to this story is at the bottom of
this message.
Hello,

How do I delete a file with a macro?
de


thx

According to the MSDN Library, there are 2 ways to delete a file:


FSO.DeleteFile(TestFilePath & "\Beatles\OctopusGarden.txt")

Set File = FSO.GetFile(TestFilePath & "\Beatles\BathroomWindow.txt")
File.Delete


FSO, as you might have guessed, has to be declared as a
FileSystemObject. GIYF for the gritty details.
 
Top