Results 1 to 3 of 3

Thread: VBA Help ASP!!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204
    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

  2. #2
    New Member
    Join Date
    Oct 2000
    Location
    Salt Lake City Utah
    Posts
    2

    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


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204
    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
  •  



Click Here to Expand Forum to Full Width