Hi all,

I wanted to share this bit of code, I often need to import and append data in excel files to local tables in an access database, often columns are added which can throw off the docmd.transferspreadsheet command in Access. The code below will use ADO to query the field names and data types of the fields in the excel file and compare against the field names in a local table, if any field names are found in the excel file that are not found in the local table the script will prompt the user if they would like to add the field to the local table. This can help avoid needing to search and manually add fields to the local table


Please Login or Register  to view this content.