flyguy80
asked on
Import Excel Spreadsheet into Access via VBA without Error table
I wrote code in VBA to import an excel spreadsheet into Access. Now because it's formatted in a weird way in excel, i'll have to clean the imported table. I get a table with the errors of the imported data. Is there a way to eliminate the error table from being created? I have no use for it
' IMPORT UNUM EXCEL SPREADSHEET AND NAME IT tblUNUMIntermittentLeaveSu mmaryRepor tTemp
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblUNUMIntermittentLeaveS ummaryRepo rtTemp", "C:\Documents and Settings\T94HGEY\Desktop\e Leave\UNUM \Intermitt ent_Leave_ Summary_Re port(1).xl s"
' IMPORT UNUM EXCEL SPREADSHEET AND NAME IT tblUNUMIntermittentLeaveSu
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblUNUMIntermittentLeaveS
flyguy80,To avoid the errors, you should load first into a "staging" table in which all of the columns use the text data type. You can then use queries and/or code to perform your data clean up and move the validated data to your permanent table(s).Patrick
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Wouldn't/couldn't the error table actually help you?
Either with cleaning things up or identifying if there is a problem with the import.
Either with cleaning things up or identifying if there is a problem with the import.