Hi All,
I've been stuck on this for the whole morning.
Somehow this generate run-time error '3274'
"External table is not in the expected format"
can this error have something to do with the range that i've selected to import...
i've checked all the excel files that i want to import. and it seem fine for those range. some files does not have 20000 rows, but it certain have the headers from A to U
and judging from no outputs from the debug prints, the error occurred on the first loop of importing, and nothing is imported.
Any advise
Thanks so much
-Hosacans
I've been stuck on this for the whole morning.
Code:
Public Function XLfilelookup()
strFolder = "C:\EXCHANGE\XLfiles\"
With Application.FileSearch
.NewSearch
.LookIn = strFolder
.FileName = "*.xls"
.Execute
For i = 1 To .FoundFiles.Count
strFile = .FoundFiles(i)
table = "Table" & i
DoCmd.TransferSpreadsheet acImport, 8, table, strFile, True, "a11:u20000"
Debug.Print strFile
Debug.Print "imported " & table
Next i
End With
End Function
Somehow this generate run-time error '3274'
"External table is not in the expected format"
can this error have something to do with the range that i've selected to import...
i've checked all the excel files that i want to import. and it seem fine for those range. some files does not have 20000 rows, but it certain have the headers from A to U
and judging from no outputs from the debug prints, the error occurred on the first loop of importing, and nothing is imported.
Any advise
Thanks so much
-Hosacans