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.