(This is a restatement of thread 705-1511265 which has evolved and I thought should be clarified).
I have a problem with the TransferSpreadSheet action. I am using this function to import a spreadsheet to a simple access table (10 fields, each defined as text). After importing, I process data in the text file, clear the file and then import another spreadsheet. Up to approx 100 spreadsheets can be processed.
The problem is that the sometimes the imported spreadsheet is not imported into the table row by row from the beginning of the spreadsheet to the end. It appears that the import can begin in the middle of the spreadsheet, it then goes to the end, then starts at the beginning and ends where it started.
Example: Let's say the spreadsheet had only one column and 6 rows with the following content:
A
B
C
D
E
F
The access table should show the data in this same order. But occasionally, it shows something like:
C
D
E
F
A
B
This problem is not always repeatable. I can import the spreadsheet a second time and then the data will be in the correct order.
Has anyone ever seen this issue and know how to respond to it?
My code is:
where strFileName is the excel file name and strWorkSheetName is the worksheet name within the file.
ex: strFileName = ALB123.xls
strWorkSheetName = ALB123!A1:F47
Thanks.
I have a problem with the TransferSpreadSheet action. I am using this function to import a spreadsheet to a simple access table (10 fields, each defined as text). After importing, I process data in the text file, clear the file and then import another spreadsheet. Up to approx 100 spreadsheets can be processed.
The problem is that the sometimes the imported spreadsheet is not imported into the table row by row from the beginning of the spreadsheet to the end. It appears that the import can begin in the middle of the spreadsheet, it then goes to the end, then starts at the beginning and ends where it started.
Example: Let's say the spreadsheet had only one column and 6 rows with the following content:
A
B
C
D
E
F
The access table should show the data in this same order. But occasionally, it shows something like:
C
D
E
F
A
B
This problem is not always repeatable. I can import the spreadsheet a second time and then the data will be in the correct order.
Has anyone ever seen this issue and know how to respond to it?
My code is:
Code:
DoCmd.TransferSpreadsheet acImport, 8, "tblTempMfgProductData", strFileName, False, strWorksheetName
where strFileName is the excel file name and strWorkSheetName is the worksheet name within the file.
ex: strFileName = ALB123.xls
strWorkSheetName = ALB123!A1:F47
Thanks.