Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Lexington Park, Maryland, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending Tables to Excel (Access 2000)

    I have been successful in sending tables and queries to excel using the following code:

    DoCmd.TransferSpreadsheet <transfertype>[, spreadsheettype], tablename, filename[, hasfieldnames][, range]

    My problem is that, I ideally need to be able to send that data to specific ranges in the spreadsheet. However, this code does not allow for the range to be specified when you are exporting data. Do you know a way around this?

    Also, do you know if it is possible to send a chart object from Access to Excel? I would also need the data to go with it and all options selected for the Access chart object to travel to excel.

    Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sending Tables to Excel (Access 2000)

    It might be better to approach this from the Excel side. You can use Data | Get External Data | New Database Query to import/link Access data into Excel, and create a chart in Excel based on the linked data.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Lexington Park, Maryland, USA
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sending Tables to Excel (Access 2000)

    That worked. How do I get it to automatically do this with one or 2 clicks of a button or buttons? I think I would like a button in access to open the excel sheet and then maybe a button in excel to refresh the data.

    Mike

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sending Tables to Excel (Access 2000)

    You can open an Excel workbook from Access using Application.FollowHyperlink or using the ShellExecute API function. See for example <post#=320106>post 320106</post#>.

    To refresh a linked table in Excel:

    ActiveSheet.QueryTables(1).Refresh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •