Kill Statement

B

Bob

Hello All,

I am printing reports to file in a specific folder. But
first I use the Kill statement to delete all the files in
the specific folder.

The problem is when the folder is empty. A dialogue box
pops up and states "Object not found". How can I get
around this? I need to use the Kill statement just in
case there are files in the folder.

Thanks
 
T

Tim Ferguson

If Dir("C:\HousAuth\*") > "" Then

Just as a note, this is far more efficient and quicker:-

If Len(Dir("c:\houseauth\*"))>0 Then


although both work fine.


Tim F
 

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