Results 1 to 4 of 4
  1. #1
    jim wv is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    4

    Access to Excel 2007 export annoyance


    Hello,

    I've globally disabled the "Always create backup" general option for Excel 2007, but this only works when I start up from Excel. When I export to Excel 2007 within Access 2007, which I do very frequently, the resulting spreadsheet has this (quite annoying and unnecessary feature for me, anyway) turned back on. I can export to .xls without this issue, but prefer the more compact .xlsx format.

    Anyone have a fix for this? thanks

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    is that feature in the excel options? if it is, record a macro while turning the option off through the interface and copy the code excel creates over to access.

  3. #3
    jim wv is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    4
    Ah, I see the CreateBackup:=False, I take it that I should create a macro to do this in access. Will try! Thanks

    Sub macro1()

    ActiveWorkbook.SaveAs Filename:= _
    "C:\Documents and Settings\My Documents\Book1.xlsx", FileFormat:= _
    xlOpenXMLWorkbook, CreateBackup:=False
    Application.Goto Reference:="macro1"
    End Sub

  4. #4
    bluebell is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    1

    Disable Excel Backup When Exporting From Access2007

    Hi,

    Finally this one works

    here is the full code

    Dim DB As Database
    Dim XLApp, WB As Object

    Set DB = CurrentDb

    'YourFileName - Access Query Name or TableName
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "YourFileName", "C:\TEST\TEST.xlsx"

    Set XLApp = CreateObject("Excel.Application")
    Set WB = XLApp.workbooks.Open("C:\TEST\TEST.xlsx")
    XLApp.DisplayAlerts = False
    WB.SaveAs FileName:="C:\Test\Test.xlsx", CreateBackup:=False
    WB.Close SaveChanges:=True
    XLApp.DisplayAlerts = True
    DB.Close
    Set DB = Nothing

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

Similar Threads

  1. Export from Access to Excel
    By Eowyne in forum Import/Export Data
    Replies: 5
    Last Post: 04-23-2011, 07:08 PM
  2. Access date export to excel
    By jituknows in forum Access
    Replies: 1
    Last Post: 02-05-2011, 01:32 PM
  3. Access 2007 Export weirdness - need help
    By Longwell in forum Access
    Replies: 1
    Last Post: 10-17-2010, 11:13 AM
  4. Access export to Excel
    By Rick West in forum Import/Export Data
    Replies: 4
    Last Post: 01-09-2010, 03:40 PM
  5. Replies: 0
    Last Post: 11-17-2009, 02:35 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