Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Thanked 0 Times in 0 Posts

    Import from excel (Access 2000)

    I am importing the excel file with the following function:
    Dim strFile As String
    strFile = "C:HousePricelist.xls"
    DoCmd.TransferSpreadsheet _
    TransferType:=acImport, _
    SpreadsheetType:=acSpreadsheetTypeExcel97, _
    TableName:="Pricelist", _
    FileName:=strFile, _
    The function is ok, could I have however a better command on it? For example of all the coloumns in the excel file I want to import only several and to rename them.For example I want to import onlye the coloumns F1,F2,F3 and F4. And I want to rename them accordingly Furniture, Kitchen, etc.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Import from excel (Access 2000)

    You cannot do that in TransferSpreadsheet.

    One option is to modify the table after importing it.

    Another option is to create a table with the fields and field names that you want. You have to do this only once. Then, after importing the Excel file, run an append query that adds the records from the imported table to the destination table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts