|
-
Oct 9th, 2000, 09:18 AM
#1
Thread Starter
Addicted Member
I trying to create a file ck in VBA. I want to use a if statment to ck to see if a file exist then do what ever. Can somebody help
-
Oct 9th, 2000, 11:51 AM
#2
New Member
Give this a try
IF FileExists(lsFileName) Then
'DO stuff the file was found
Else
'Do something else the file wasn't foudn
END IF
Public Function FileExists(pstrFileName As String) As Boolean
FileExists = False 'set the return value by default
If Len(Dir(pstrFileName)) > 0 Then 'Dir will return the filename if the file is found
FileExists = True 'Return true the file exists
End If
End Function
-
Oct 10th, 2000, 06:14 AM
#3
Thread Starter
Addicted Member
Thanks for the help it works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|