Via vba, you would use Docmd.actransferspreadsheet Acimport,, "your file name",
"C:\whatever" , true, "sheet1!A4:d10"
The true is if you have column headers you want to import with the document.
Easiest is to use the Access menu; select File... Get External Data... Import;
select .xls on the "files of type" dropdown, and then your workbook file.
TransferSpreadsheet does the same thing in VBA code and would be better for a
recurring task.
The line of code "Docmd.actransferspreadsheet Acimport,, "your fil
name",
"C:\whatever" , true, "sheet1!A4:d10" " should be written in the Acces
or Excel? If I were to write it in Excel VBA, how do I modify the code?
Thank you so much for your help.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.