Importing Text Files

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.
 
G

G. Vaught

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.
 
D

Douglas J. Steele

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
 
S

Stephen

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
 
S

Stephen

Wait a second.
Isn't there a table generated with each error?

Sorry for the empty post!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top