Checking for the existence of a file 
Author Message
 Checking for the existence of a file

I am able to name a file with a long file name, Thanks.

How do I check for the existence of a file so that I can delete it before I
use the VBA name statement to rename a file.  I get an error whenever I run
the procedure and the file already exists.  Need to check and delete if it
is already there.

TIA,

Dave



Sat, 26 May 2001 03:00:00 GMT  
 Checking for the existence of a file
 Hi, Everybody!

 The simplest way is to use dir() function, but it works fine when you
have "File Scan" right for that file. Otherwise you may try open file
(you should have "Read" right) or use "On Error ..." stuff like this:

 On Error Resume Next
 Kill "X:\Dir\MyFile.Ext"
 On Error Goto 0

 Hope this helps.

On Tue, 8 Dec 1998 10:18:41 -0700,In
microsoft.public.access.modulesdaovba,

Quote:

>How do I check for the existence of a file so that I can delete it before I
>use the VBA name statement to rename a file.

           Best regards, Serg.

*** Remove asterisk for mail reply!!!


Sat, 26 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Checking for the Existence of a File

2. Check for the existence of a file.

3. Check for the existence of the file

4. A2K Check for Existence of Back End File

5. How to check for existence of a file on harddisk form OL VBscript

6. Check File Existence?

7. Checking for random file existence in Visual Basic

8. Checking for existence of a file???

9. Check for existence of a file?

10. Checking for existence of a file...

11. Checking the Existence of a File

12. Newbie Question: File existence checking

 

 
Powered by phpBB® Forum Software