Unanswered: code to import xls files (urgent please help)
is there anyone out there that can help me with code to import xls files into access. i know access has a built in function for it but what im trying to do is to make a switchboard with a command button that:
1. imports a selected xls file
2. appends the file to the main table
3. ensures the field names are the same as the main table
Originally posted by Shubharaj
You can do this by using a macro. Use the Transfer Spreadsheet function in the macro. Specify the name of the Excel file in the macro itself. Attach the macro to the switchboard.
Just a cautionary note here. I have to frequently import .xls in to a specific table and has already been pointed out the transfer spread' is the main tool but you stated that you want this system to ensure that the table has the correct record based on the spreadsheet! Does this mean that the sourse spreadsheets layout is likely to change - if it is then you could encounter problems in the upload process i.e. people have been known to "stick" a column in here and there and that will crash the process for you or some one will decide to change the format of a data range maybe because some of the xls data has itself been imported - (off on-line sources) therefore just beware of the protocols used in the source data - saves many a painkiller having to be taken