Kill Error Message

G

Guest

Hi

I have the following lines in my code to delete some exports from our
accounts system after they have been imported:

Kill "V:\NLEXP.CSV"
Kill "V:\18NLEXP.CSV"

The problem is that both files do not always exist; sometimes there is only
one to be removed and the code produces a "File Not Found" error for the file
that doesn't exist. How can I handle this error so that if one of the files
isn't present, the code doesn't stop there and produce the error message?

Thanks
Martyn

Excel 200
Windows 2003 server over Citrix
 
B

Bob Phillips

On Error Resume Next
Kill "V:\NLEXP.CSV"
Kill "V:\18NLEXP.CSV"
On Error Goto 0

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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