Link to home
Start Free TrialLog in
Avatar of flyguy80
flyguy80Flag for United States of America

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 tblUNUMIntermittentLeaveSummaryReportTemp
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblUNUMIntermittentLeaveSummaryReportTemp", "C:\Documents and Settings\T94HGEY\Desktop\eLeave\UNUM\Intermittent_Leave_Summary_Report(1).xls"
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

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
Avatar of ldunscombe
ldunscombe
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Norie
Norie

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.