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

    How suppress "Do you wnat to save excel --"Message when log off

    I'm not sure if this should be here or in Programming.

    Using A2007. I have a file that exports and imports data to an excel file. The linked Access tables and the excel file are in the same server folder along with a copy of the program.. The users have occasion to run the program on the server (from small carry around computers without Access) using Microsoft’s Desktop feature.

    The problem is, when they log off the server computer, we get annoying messages (not just one) “Do you want to save the excel file etc.” .

    The excel file has code that suppresses the “Do you want to Save---” message. When manual changes are made and the file closed or when the Access file is closed, there is no “Do you----etc.) message. Only when we Log Off the server..

    From one site I got the code below that I put into an Access form that is always open while the program is being used. My understanding is that this would close the excel file whenever Access was closed. ( It saves, but I don’t really need to save-just thought it would help).

    Private Sub Form_Unload(Cancel As Integer)
    Dim XLapp As New Excel.Application
    Dim ObjXL As Excel.Workbook
    Set ObjXL = XLapp.Workbooks.Open(ExcFile) 'function ExcFile holds location and name of excel file
    ObjXL.Save
    ObjXL.close
    XLapp.Quit
    End Sub



    Doesn't work. Driving me nuts-any guidance much appreciated.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure if you are still looking for an answer for this?

    When I had the problem, I discovered that I was saving the Excel files into an earlier version (xls as opposed to xlsx) and that some of the VBA code I was using did not match - in particular, I was setting color in cells with a color that was not available in xls. As soon as I changed it to use one of those the message stopped appearing.

  3. #3
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Thanks much-I had given up on any response on this. The excel file that I used was set to be shared. I found later that I had another real problem, like excel really wouldn't share if two people used it at close to the same time. Through forums, I found that the excel share feature is rife with problems. So dropped it. However, I will try your suggestion. It fits, in that, like you, I am using an earlier excel version (using Office 2007, but doing everything in 2003 as user has a computer with 2003). Thanks again, much appreciated.

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

Similar Threads

  1. "DLL Error" message trying to import from Excel
    By buddyboy in forum Import/Export Data
    Replies: 4
    Last Post: 03-19-2015, 06:26 PM
  2. Replies: 3
    Last Post: 01-13-2015, 05:21 PM
  3. Suppress "Error" message following "Cancel = True"
    By GraeagleBill in forum Programming
    Replies: 7
    Last Post: 03-23-2014, 05:40 PM
  4. Replies: 3
    Last Post: 11-15-2011, 02:41 PM
  5. Replies: 11
    Last Post: 11-26-2010, 10:53 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