Importing Text Files

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

hi,

i'm successfully importing text files into tables, etc.

my question is; how can i capture an error if a file is not present (ie
- has been deleted)

joe.
 
You have to write error checking into code that executes the importing of
those files. I believe IFExists is the function to use.

Sorry, I don't have any code available to help you with this.
 
Assuming you're using VBA in a module, you can use:

If Len(Dir(strFullPathToFile)) > 0 Then
' the file exists
Else
' the file does not exist
End If
 
Douglas J. Steele said:
Assuming you're using VBA in a module, you can use:

If Len(Dir(strFullPathToFile)) > 0 Then
' the file exists
Else
' the file does not exist
End If
 
Back
Top