ay3314
asked on
Import Routine from Excel into Access
Does anyone have a generic import routine from Excel into Access? I am receiving a file in xls format weekly. What I would like to do is to name the file as file062201.xls (today), file062901.xls which would be the file I receive next week. I am going to save these files into one directory. I am looking for a generic import routine that would grab the data in excel and import into Access. This will replace any existing data in the table (as opposed to appending). Please help.
ASKER
But that's what I am looking for - code!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry for the delay
here's some code
DoCmd.RunSQL ("delete * from accesstablename")
DoCmd.TransferSpreadsheet , acImport, accesstablename, "ExelPath",True(hasfieldna
2. having linked the spreadsheet you could either run a query to replace the table data or do it in code.