Results 1 to 4 of 4
  1. #1
    Andrias14 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    25

    Exporting to Excel

    I have a macro that exports a table with formatting, but that creates a new excel wordbook, i was wondering if their is any way of exporting it to an existing workbook

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I don't know about macros but in VBA if you use an existing file to export to then it will create another tab (or overwrite one with the same name). Can you specify an existing file name in the macro?

  3. #3
    Andrias14 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    25
    COuld you please explain how to do it in VBA

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Start typing this code and Access will tell you what is required:
    DoCmd.TransferSpreadsheet ....

    One thing it will ask you for is the file name. Sometimes it is easier to define that first - makes the code easier to read:
    Dim FileName as String
    FileName="C:\......"
    Then in the DoCmd you can reference FileName instead of typing out the whole path name. Don't put quotes around it like you will need for the query/table name.

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

Similar Threads

  1. exporting to Excel
    By johnririe in forum Import/Export Data
    Replies: 6
    Last Post: 08-23-2011, 10:16 AM
  2. Exporting to Excel Help
    By Coffee in forum Import/Export Data
    Replies: 4
    Last Post: 07-18-2011, 07:37 AM
  3. Exporting to Excel
    By TheDeceived in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:56 AM
  4. Exporting to Excel
    By DreamOn in forum Import/Export Data
    Replies: 1
    Last Post: 05-23-2010, 10:27 PM
  5. Really Need Help With Exporting to Excel
    By graviz in forum Import/Export Data
    Replies: 0
    Last Post: 09-24-2009, 08:29 AM

Tags for this Thread

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