Testing for file existence 
Author Message
 Testing for file existence

Easy one this.

How do I test for the existence of a file in VBA?

Thats it.

Cheers

Ken
(please reply to email)



Tue, 28 Nov 2000 03:00:00 GMT  
 Testing for file existence

Hi Kenneth,

Try this function.

'***************** Code Start *******************
Function fIsFileDIR(stPath As String, _
                    Optional lngType As Long) _
                    As Integer
'Fully qualify stPath
'To check for a file
'   ?fIsFileDIR("c:\winnt\win.ini")
'To check for a Dir
'   ?fIsFileDir("c:\msoffice",vbdirectory)
'
    On Error Resume Next
    fIsFileDIR = Len(Dir(stPath, lngType)) > 0
End Function
'***************** Code End *********************

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------


:Easy one this.
:
:How do I test for the existence of a file in VBA?
:
:Thats it.
:
:Cheers
:
:Ken
:(please reply to email)
:
:
:



Tue, 28 Nov 2000 03:00:00 GMT  
 Testing for file existence

Dir


Quote:
>Easy one this.

>How do I test for the existence of a file in VBA?

>Thats it.

>Cheers

>Ken
>(please reply to email)



Sun, 03 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Testing for file existence

2. Need efficient way of repeatedly test for file existence

3. Need efficient way of repeatedly test for file existence

4. Testing for the existence of a file

5. File existence test?

6. File existence testing

7. Testing a file for existence?

8. Test file existence

9. TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST

10. Testing for existence of a query

11. Testing for Existence of Table

12. Testing for a record already in existence

 

 
Powered by phpBB® Forum Software