According to the documentation: Application.Quit does the same as DoCmd.Quit . Namely
The Quit method terminates Microsoft Access. You can select one of several options to save the database object before exiting the system.
You can try to call any of them with the parameter acQuitSaveNone or 2, which "Turns off Microsoft Access without saving any objects." For further consideration, use Application.Quit , since DoCmd.Quit been added for backward compatibility for Access 95 (see Notes for the Quit method, as applicable to the DoCmd object.) Performing either of these should still perform automatic compression upon closing. if you have permissions, what could be causing your shells.
If this does not work for you, here is a somewhat extreme suggestion. Save this as a vbscript file and call it as soon as you really finish with Access. This will terminate all MSAccess processes on your Windows PC without compression or repair.
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Process WHERE Name = 'msaccess.exe'") For Each objProcess in colProcessList objProcess.Terminate() Next
To invoke the script, replacing [vbspath] with the actual path. If the path has spaces, be sure to use double quotes and put it in quotes:
shell "cscript [vbspath]"
Daniel Cook
source share