Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA code that will import an excel file but not the field label

Status
Not open for further replies.

maupiti

Programmer
Oct 27, 2003
240
US
Access 2003.

What is the VBA code that will import an excel file but will not include the field name in the Excel file. If the Access table field name is different from the field name in the Excel spreadsheet it won 't import.

/////////////////////////////////////////////////////

DoCmd.TransferSpreadsheet acImport, 8, "AccessTableName", "FileAndPathName", 0, "SheetName!StartofRange:EndofRange"
 
A common way is to import the excel file into a temporary table and then play with an append query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top