Results 1 to 5 of 5
  1. #1
    charly.csh is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2014
    Posts
    186

    Export table to Excel (option to choose the root)

    Hi everyone,



    I am trying to make an exportation to Excel and it's showing an error:

    '************************
    Private Sub Excelcmd_Click()
    'Access 365

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Test", "C:\Users\XXXX\Desktop\Book1.xlsx", True

    '************************

    (error 3011: the microsoft office access database engine could not find the object)
    it's weird because when I see into the folder on the root the file is there, once I want to open it, it shows is damaged

    Any idea how to correct this?
    And second question, does somebody know how to get alternative to choose the root instead of getting predefinded?
    ( "C:\Users\XXXX\Book1.xlsx")

    Thanks in advance for the help!!!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Why are you using Excel9? Try Excel12Xml

    If you want user to select a folder location, use FileSystemObject dialog. Common topic.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    charly.csh is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2014
    Posts
    186
    In fact I tried it as well and same error message is shown (error 3011)

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "Test", "C:\Users\XXXX\Book1.xlsx", True

    The only difference is that at least it can be opened but no info...

    Any idea why? or how to correct this?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    No idea. Since a file is created, can't be a folder permissions issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    What result does just opening the query "Test" give you?
    Does it run?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Replies: 6
    Last Post: 03-16-2021, 09:39 AM
  2. Export Filtered table to Excel, Edit and Re-Import Changes to Access Table
    By Access_throwaway in forum Import/Export Data
    Replies: 15
    Last Post: 02-20-2018, 12:37 PM
  3. Replies: 3
    Last Post: 04-07-2016, 04:36 AM
  4. Choose Import Spec from option group
    By thart21 in forum Import/Export Data
    Replies: 4
    Last Post: 06-29-2011, 10:37 AM
  5. Export table to excel using excel template
    By allenjasonbrown@gmail.com in forum Programming
    Replies: 1
    Last Post: 06-27-2011, 02:10 AM

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