Delete File in a folder

L

Les Stout

Hi all, i save a file to a folder using a certain name and after i have
finished with it and closed it i need to delete it. I have played with
some code but just cannot get it to work. Could somebody help me out of
my misary please !!

Les Stout
 
R

Raymond Cruz

Set fs = CreateObject("Scripting.FileSystemObject")
Set obj = fs.GetFile("your-file-name")
obj.Delete
 
T

Tom Ogilvy

If you want to use the built in VBA capabilities:

Kill "C:\MyFolder\MyFile.xls"
 
B

Bob Phillips

Kill full_filename_including_path

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Top