Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Export to Excel from Access (2003)

    Hi

    I am trying to use a form to export a qry into an excel template. Everything seems to work in the code (no errors) but no data gets put in the spreadsheet from the source table which curently has one record in it.

    Heres the code I used

    DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel9, "TblTest", "H:Test.xls", -1

    Any ideas

    Thanks
    Regards
    Gerbil (AKA Kevin)

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Export to Excel from Access (2003)

    This might not be the best board for your question. This method has been a popular topic on the Access board, as you can tell from this Lounge search (in Access) for transferspreadsheet. Microsoft has a basic reference page online here: TransferSpreadsheet Method [Access 2007 Developer Reference].

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

    Re: Export to Excel from Access (2003)

    This question was originally posted in the VBA forum. Since it is about Access, I have moved it to the Access forum, where it belongs.

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

    Re: Export to Excel from Access (2003)

    The default value for the first argument is acImport; since you don't supply a value for the first argument, acImport is assumed. You should use acExport. Please look up the help for TransferSpreadsheet and read it carefully.

Posting Permissions

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