Results 1 to 3 of 3
  1. #1
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202

    docmd.transferspreadsheet from excel to access with different range

    Good afternoon, I am attempting to import from excel to an existing table in access. I have a long code, but am struggling with one line. I want to import selected columns as my spreadsheets can include >50,000 rows and do not need all the other data from the other rows. I only need columns L,O,P,R.

    Currently works importing rows L through R as expected.
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblImportFM_Sol", SelectedFile, True, "Solicitations Detail!L:R"




    I have tried multiple different ways, but cannot figure out how to do selected columns. Only thing I can find with research is below and it gives me the error code 3011. I do not want to try and put it in a qry and do sql.
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblImportFM_Sol", SelectedFile, True, "Solicitations Detail!L:L,O:O"

    Any help would be appreciated.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    You cannot select specific columns only a range

    Suggest use transferspreadsheet to link to the excel file then have a query using the linked table as a source to append to the destination table

  3. #3
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202
    Thank you.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. DoCmd.TransferSpreadsheet Range Argument
    By RunTime91 in forum Access
    Replies: 2
    Last Post: 09-10-2020, 12:57 PM
  2. DoCmd.TransferSpreadsheet for a found range
    By Sephaerius in forum Modules
    Replies: 5
    Last Post: 03-01-2019, 02:34 PM
  3. Replies: 11
    Last Post: 03-02-2016, 11:01 AM
  4. Replies: 12
    Last Post: 10-08-2014, 02:35 PM
  5. Importing Excel file: ADODB, DAO or DoCmd.TransferSpreadsheet
    By Monterey_Manzer in forum Import/Export Data
    Replies: 3
    Last Post: 08-13-2013, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums