How to check if file present

Davef28

Registered User.
Local time
Today, 12:04
Joined
Feb 6, 2002
Messages
51
Is it possible to use some vba code to test if a file is present in a specific directory. I am trying to append using TransferText but I do not think I can do it, therefore I need an alternative way, which I have if I can get a solution to this Question.

Thanks

Dave
 
try,


Dim MyFile

' Returns "test.txt" if file exists, Null if not.
MyFile = Dir("C:\Myfolder\test.txt")


hth,
al
 
Thanks, works a treat.
 

Users who are viewing this thread

Back
Top Bottom