DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8

  • Thread starter Thread starter Boon
  • Start date Start date
B

Boon

Hello,

I have vba that will import the data from Excel file. Is it possible to
append the data from excel file to a table in Access in such a way that
excel file does not have a field's name? When I run this transferspreadsheet
command, it comes in as F1, F2,.....

thanks,
 
Hello,

I have vba that will import the data from Excel file. Is it possible to
append the data from excel file to a table in Access in such a way that
excel file does not have a field's name? When I run this transferspreadsheet
command, it comes in as F1, F2,.....

thanks,

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
"MyTable", "C:\MyFile.xls", True

Note the TRUE... that means "tell Access that the first row is column
headings, so don't import that.... you must have it set to false.
 
Put the field names in the first row of the spreadsheet. Then on the
transferspreadsheetmethod, you can tell Access where to start linking or
importing. Like this:DoCmd.TransferSpreadsheet acLink, , "0709 payment
tracking", "P:\fileshare\milton 0709 disbursement", True, "sheet1!a2:s595"
 
Back
Top