A2K Importing Excel into Access not always consistent - why? -
01-31-2011
, 06:37 AM
I'm importing various Excel spreadsheets and sometimes the data being
imported is different.
By different I mean rows can be in the wrong order or, more worrying, not
all rows will be imported. If I try again it will work. For some imports
that require keying on a specific phrase in the imported file that is
precisely what I'm doing - I simply import again and it works.
Further testing reveals that incorrect imports can happen seemingly randomly
even after they initally appear to work.
I'm using this code;
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "tmpNew",
VFileName, 0
Questions;
Why is this happening?
And should I try to determine the Excel type before I run the code? I've
settled on acSpreadsheetTypeExcel8 but could this be a problem when
importing from older or newer versions of Excel. I have accounted for Excel
4 which is not accepted as an error is trapped for that. |