Deleting a file via a macro

  • Thread starter Thread starter Sarah at DaVita
  • Start date 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?
 
VB has a Kill command that you should be able to use. Try this line...

Kill "C:\StoreTabFile.XLS"
 
What do I put in there to tell the macro to continue if it cannot find the
file to kill?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top