Results 1 to 4 of 4
  1. #1
    c2part2 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    2

    Import Excel files into Access, run query, export results in XLS

    I'm sure that this has been covered ad nauseaum but please humor me.

    I'm essentially trying to:
    1. Import XLS1 into existing tbl1 in Access
    2. Import XLS2 into existing tbl2 in Access
    3. Run existing query1 in Access
    4. Export query1 results in XLS format
    5. Empty the contents of tbl1 and tbl2

    The kicker is that I'd like to prompt users to browse for the file path of XLS1, XLS2, and the destination of query1 results.



    Any advice or pointers for a beginner?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Simple sample for browsing for files

    AAR.zip

    once you define the files you want to import you can do that with the docmd.transferspreadsheet or some other method

    If query1 is a simple select query based on the contents of the two spreadsheets you can just export it and disconnect the linked tables or if you're importing directly into tables instead of linking you can run delete queries to clear out the information.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    And Ken Snell has a site for importing/exporting XLS workbooks:

    http://www.accessmvp.com/KDSnell/EXCEL_MainPage.htm


    Also, I would suggest creating import specs when importing Excel workbooks.

  4. #4
    c2part2 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    2
    Thanks everyone, the accessmvp looks good. I'll give that a try.

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

Similar Threads

  1. Replies: 11
    Last Post: 12-20-2012, 12:30 PM
  2. Replies: 1
    Last Post: 06-27-2012, 07:39 AM
  3. import excel files into access automatically
    By jstei012 in forum Import/Export Data
    Replies: 1
    Last Post: 12-19-2011, 04:12 PM
  4. Replies: 3
    Last Post: 10-06-2011, 06:53 AM
  5. Export Query to Various Excel Files
    By dalet in forum Import/Export Data
    Replies: 7
    Last Post: 11-09-2009, 09:22 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