Results 1 to 3 of 3
  1. #1
    wharting is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2011
    Location
    Netherlands
    Posts
    40

    Export from query to excisiting Excelfile

    Hi,

    I want to export query results to an excisting Excel file. In the Excel file I've a pivot table that should be updated every month with fresh data so the data of a former month should be deleted.


    Exporting to Excel offcourse isn't a problem but how to do it in VBA in the way I want it?
    Thanks in advance.

    Best regards,
    Willem

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You will likely have to delete the existing file (if you use the same file name over and over) using the filesystemobject commands. There are tons of resources for using filesystemobject just google it.

    Then just re-export your query with the same file name etc. using the transferspreadsheet command in your vb code.

    You'd just have to add a button to one of your forms to perform the export when you wanted.

  3. #3
    wharting is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2011
    Location
    Netherlands
    Posts
    40
    The issue was to export data to a specific worksheet in an excisting Excel file without deleting turntable's.
    I've tried several times and finally I got it working as I want it to work.
    Thanks anyway.

    Best regards,
    Willem

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

Similar Threads

  1. Query export problems
    By Jedat in forum Access
    Replies: 4
    Last Post: 03-18-2011, 03:48 AM
  2. Export query to Excel
    By dev82 in forum Queries
    Replies: 15
    Last Post: 02-10-2011, 11:15 AM
  3. Export query design
    By somm in forum Access
    Replies: 2
    Last Post: 01-20-2011, 03:17 AM
  4. Export query to CSV
    By daniel.preda in forum Import/Export Data
    Replies: 3
    Last Post: 12-30-2010, 08:52 AM
  5. Export query without saving
    By prag in forum Queries
    Replies: 1
    Last Post: 11-18-2009, 06:22 PM

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