Results 1 to 3 of 3
  1. #1
    andydarly is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    6

    Export Code

    Hi, I am trying to export a query from Access to a binary Excel file. I have about 12 set up, all very similar (just names and locations change).



    With this one though it runs in Access when I run it but on the export Module it always crashes Access if I want it as a binary Excel file using the below:

    DoCmd.TransferSpreadsheet acExport, 9, "qry_ATTA_ABR_1617_Q3", "DriveLocation\qry_ATTA_ABR_1617_Q3.xlsb"

    If I run it as part of the module as:

    DoCmd.TransferSpreadsheet acExport, 10, "qry_ATTA_ABR_1617_Q3", "DriveLocation\qry_ATTA_ABR_1617_Q3.xlsx"

    it works absolutely fine.

    All my exports (like I say around 12 of them, all work fine as binary excel documents). Any idea why this one doesn't work as Binary? For the period I want there are some 9000 rows so not a lot at all.



    Please help!!

    Thanks in advance.

    Andy

  2. #2
    andydarly is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    6
    Hi. Anyone any ideas at all?

    Cheers

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    exportexcel type 10 is xml. 9 should work for .xlsb. If it works for other queries, perhaps there is some data which is not converting successfully to binary. What happens if you use 9 to .xlsx? does that work?

    and if it works what happens if you open the .xlsx and save as binary?

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

Similar Threads

  1. Replies: 6
    Last Post: 10-04-2014, 12:22 PM
  2. VBA code multiple export to xml with filter
    By Bertrand82 in forum Programming
    Replies: 9
    Last Post: 01-15-2013, 03:55 AM
  3. VBA code for export to pdf file
    By Milan25 in forum Programming
    Replies: 4
    Last Post: 02-01-2011, 12:37 PM
  4. Use of CurrentProject.Path in export code
    By gg80 in forum Programming
    Replies: 1
    Last Post: 08-02-2010, 08:51 PM
  5. Using code to set export specs
    By SSylvesterSYC in forum Programming
    Replies: 0
    Last Post: 06-08-2009, 10: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