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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to import .xls document and keeping the headers?

Status
Not open for further replies.

chrisjohns

Technical User
Mar 1, 2009
11
0
0
GB
Hi all,

I can currently import an excel document into my tool using the below command

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "AnnualData", strFile, True

However, this doesnt include the column headings, instead filling the headings with a cell value. On the import it doesnt give you the option to create an import specification but the wizard does allow you to keep headings so there must be a solution somewhere. I can't populate a predefined table as the column headings sometimes change.

I am in Access97.

Thanks
 
this doesnt include the column headings
Does the 1st row of the spreadsheet contains consistent heading values ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top