Deleting a file via a macro

  • Thread starter Sarah at DaVita
  • Start date
S

Sarah at DaVita

I need to delete a file before I start up a macro. I want to just have this
as part of the macro I run. I don't understand how to use the deleteFile
method. The file I want to delete is C:\StoreTabFile.XLS. The help screen
mentions a FileSystemObject but I do not know what that is. Can someone help
me out?
 
R

Rick Rothstein

VB has a Kill command that you should be able to use. Try this line...

Kill "C:\StoreTabFile.XLS"
 
S

Sarah at DaVita

What do I put in there to tell the macro to continue if it cannot find the
file to kill?
 
Top