Results 1 to 3 of 3
  1. #1
    coach32 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    47

    Export table to pre-existing worksheet in a workbook

    I have searched and searched and I'm still unable to find the right answer.
    I would like to export a table I have created in Access ("tbl_1974") to an existing worksheet (Named "1974"") in an existing workbook ("Scores")
    The data would naturally paste from A1 and take up 6 columns. The reason I want to use an existing worksheet is that the sheets already have prepared formulas
    from Column J on wards. Those formulas are just waiting for the data to be entered.
    I have many years to do, so I am hoping that this is possible.


    I tried the following code but that just created a new worksheet with "_1974" as the title
    Code:
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "1974", "C:\Documents\LADDERS SORTED\scores.xlsm", True, "1974"

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You might look at examples for exporting at Ken Snell's site
    http://www.accessmvp.com/kdsnell/EXCEL_Export.htm

    Maybe try
    Write Data From a Recordset into an EXCEL Worksheet using Automation (VBA)
    http://www.accessmvp.com/kdsnell/EXC...m#WriteRstFile


    There is a section of code
    Code:
    ' Replace C:\Filename.xls with the actual path and filename
    ' of the EXCEL file into which you will write the data
    Set xlw = xlx.Workbooks.Open("C:\Filename.xls")
    where you could add code to use "fsoFilePicker" to get the file name instead of hard coding the path/filename.....

  3. #3
    coach32 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    47
    Thank you for the response, I will check these out. Greatly appreciated.

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

Similar Threads

  1. Worksheet within Excel Workbook
    By rpkfish in forum Macros
    Replies: 4
    Last Post: 05-06-2016, 03:02 PM
  2. Replies: 2
    Last Post: 05-16-2013, 07:43 PM
  3. export quety result to existing excel workbook
    By jsimha in forum Import/Export Data
    Replies: 1
    Last Post: 01-19-2013, 06:49 AM
  4. export query into existing workbook
    By hklein in forum Programming
    Replies: 3
    Last Post: 05-08-2012, 04:55 AM
  5. Replies: 1
    Last Post: 11-21-2010, 10:26 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