M
Minh Le
Hi all,
I would like to capture error files that are failed to import. Below is my
code
Dim myfile
Dim mypath
mypath = "C:\Documents and Settings\"
myfile = Dir(mypath & "*.xls")
While myfile <> ""
'this will import ALL the excel files (one at a time, but automatically)
in this folder. Make sure that's what you want.
DoCmd.TransferSpreadsheet acImport, 8, "PR", mypath & myfile, True
I need some code here to capture files that are failed.I don't know how to
write the code to check for error files.
if DoCmd.TransferSpreadsheet acImport, 8, "PR", mypath & myfile, True is
not imported, then
How do i check the line above for error file???
MsgBox "Transfer Failed: " & vbCrLf & "XLS: " & myfile&
End If
myfile = Dir
Wend
I would like to capture error files that are failed to import. Below is my
code
Dim myfile
Dim mypath
mypath = "C:\Documents and Settings\"
myfile = Dir(mypath & "*.xls")
While myfile <> ""
'this will import ALL the excel files (one at a time, but automatically)
in this folder. Make sure that's what you want.
DoCmd.TransferSpreadsheet acImport, 8, "PR", mypath & myfile, True
I need some code here to capture files that are failed.I don't know how to
write the code to check for error files.
if DoCmd.TransferSpreadsheet acImport, 8, "PR", mypath & myfile, True is
not imported, then
How do i check the line above for error file???
MsgBox "Transfer Failed: " & vbCrLf & "XLS: " & myfile&
End If
myfile = Dir
Wend