Thread: Deleting a File
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jd jd is offline
external usenet poster
 
Posts: 91
Default Deleting a File

Kill "H:\Personal\SIGNCUSTODY.csc"



"Steve" wrote:

Hi

The last part of my macro is a save command:
ActiveWorkbook.SaveAs
Filename:="H:\Personal\SIGINCUSTODY.csv", FileFormat _
:=xlCSV, CreateBackup:=False

I have a problem, however, in so far as a file of this
name already exists and I want to either:
a) overwrite it automatically (without being asked),or
b) delete it at the start of my macro.

The second option is my preferred option.

Can anyone show me how to do it ?

Thanks in advance