G
Guest
I have a procedure that scans a specific folder and imports *.xls files (over
60) into my database. The import works fine except that “sometimes†some of
the resulting tables are not in the same sequence as the original
spreadsheet. If I import them manually using the wizard, everything is ok but
as these sheets change frequently, I really do need the automated process to
work. I have tried adding them to tables that have autonumber keys defined
but this makes no difference. It’s not always the same spreadsheets – it
varies. Can anyone help please? I am using Access 2003 with SP2.
The import procedure is;-
With Application.FileSearch
.LookIn = strImportPath
.SearchSubFolders = False
.FileName = "*.xls"
If .Execute() > 0 Then
lngFiles = .FoundFiles.Count
For i = 1 To lngFiles
strFileName = ExtractFileName(.FoundFiles(i))
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
strFileName, (.FoundFiles(i)), False
Next i
End If
End With
60) into my database. The import works fine except that “sometimes†some of
the resulting tables are not in the same sequence as the original
spreadsheet. If I import them manually using the wizard, everything is ok but
as these sheets change frequently, I really do need the automated process to
work. I have tried adding them to tables that have autonumber keys defined
but this makes no difference. It’s not always the same spreadsheets – it
varies. Can anyone help please? I am using Access 2003 with SP2.
The import procedure is;-
With Application.FileSearch
.LookIn = strImportPath
.SearchSubFolders = False
.FileName = "*.xls"
If .Execute() > 0 Then
lngFiles = .FoundFiles.Count
For i = 1 To lngFiles
strFileName = ExtractFileName(.FoundFiles(i))
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
strFileName, (.FoundFiles(i)), False
Next i
End If
End With