Results 1 to 10 of 10
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    Export to exce-suppress save message

    I am using Office 2003. I can successfully export some data to excel, but after the export, I always get a message "Do you want to save the changes etc.". How can I suppress the message and still save the exported data in excel. Any help much appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    I have never seen this message.
    are you using TransferSpreadsheet?

  3. #3
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Quote Originally Posted by ranman256 View Post
    I have never seen this message.
    are you using TransferSpreadsheet?
    This is the code. It sends the data fine. I just want to get rid of the message after export: "Do you want to save changes etc."

    Dim oXL As Excel.Application
    Dim oWB As Excel.Workbook
    Dim oSheet As Excel.Worksheet
    Dim oRng As Excel.Range

    On Error GoTo Err_Handler

    ' Start Excel and get Application object.
    Set oXL = CreateObject("Excel.Application")
    oXL.Visible = False

    Set oWB = oXL.Workbooks.Open(Application.CurrentProject.Path & "\PHDW_DB_Jim_070318_TEST") '

    Set oSheet = oWB.Sheets("database") ' export to a specific sheet

    oSheet.Cells(2, 1).Value = Me.IDboat
    oSheet.Cells(2, 2).Value = Me.BOAT_NAME
    oSheet.Cells(2, 3).Value = Me.I
    etc.

    '

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Do you have code to close the workbook, like:

    oWB.Close savechanges:=True
    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
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Quote Originally Posted by June7 View Post
    Do you have code to close the workbook, like:

    oWB.Close savechanges:=True
    I should have shown you the closing code. Sorry. Here it is.

    oXL.Quit
    Set oRng = Nothing
    Set oSheet = Nothing
    Set oWB = Nothing
    Set oXL = Nothing



    Exit Sub

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Did you try suggestion?
    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.

  7. #7
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Quote Originally Posted by June7 View Post
    Did you try suggestion?
    Yes. When I make oWB.close savechanges=False, the excel file doesn't show the export data.. If make it =True, Access locks up and excel file stays open and I have to close excel with Task Manager.

    I did modify an excel file with VBA to get rid of the "Do you want to Save etc.message. the disadvantage of that is that the excel user may make some changes and may lose them. Puzzling. I have some old files without this problem.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Well, the code works for me so without examining your code and/or files, really can't determine cause of 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.

  9. #9
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Quote Originally Posted by June7 View Post
    Well, the code works for me so without examining your code and/or files, really can't determine cause of issue.
    Thanks for help, much appreciate it. . I will set up a new file and try again.

  10. #10
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Best way is to suppress message in Excel file. Se https://support.microsoft.com/en-us/...kbook-in-excel

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

Similar Threads

  1. suppress the message when item not in list
    By Derrick T. Davidson in forum Programming
    Replies: 6
    Last Post: 01-15-2016, 07:28 PM
  2. Replies: 2
    Last Post: 07-31-2015, 02:49 PM
  3. Replies: 6
    Last Post: 11-26-2013, 09:20 AM
  4. Suppress warning save changes to layout of table
    By bbrazeau in forum Programming
    Replies: 7
    Last Post: 02-13-2012, 01:57 PM
  5. Suppress spell check error message
    By sabre1 in forum Forms
    Replies: 1
    Last Post: 03-24-2011, 09:58 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