Results 1 to 2 of 2
  1. #1
    xopherira is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Indiana
    Posts
    53

    transferspreadsheet using excel workbbook index


    Is it possible to use transferspreadsheet with excel worksheet index? I would like to use index(1) in place of Sheet1.

    Code:
    .TransferSpreadsheet acImport, 10, "foo_table", Application.CurrentProject.Path & "\Data Pulls\foo_worksheet.xls", True, "Sheet1!A1:H"

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    I think you will have to use automation to open the file (can be in the background) and get the name of Sheet(1). Access doesn't seem to like a reference to the worksheet index e.g. Sheets(1) in the DoCmd syntax.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. 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
  2. Import from Excel using TransferSpreadsheet
    By Sephaerius in forum Import/Export Data
    Replies: 6
    Last Post: 08-07-2013, 04:55 AM
  3. Import from Excel Using TransferSpreadsheet
    By P5C768 in forum Import/Export Data
    Replies: 10
    Last Post: 05-01-2013, 01:17 PM
  4. TransferSpreadsheet to Excel (Multiple Tabs)
    By smoothlarryhughes in forum Import/Export Data
    Replies: 9
    Last Post: 11-10-2012, 12:59 PM
  5. Replies: 2
    Last Post: 02-27-2010, 06:53 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