ACC: How to Use the Quit Macro Action or Quit MethodID: Q100149
|
This article demonstrates two methods that you can use to close Microsoft Access from a different application. The first method uses the Quit macro action to quit Microsoft Access over a dynamic data exchange (DDE) channel. The second method uses Automation and the Quit method.
Quit
There are no parameters for the Quit action.
Cell Command
------------------------------------------------
A1 QuitDDEExample
A2
A3 =APP.MINIMIZE()
A4 =ERROR(FALSE)
A5 =APP.ACTIVATE("Microsoft Access",FALSE)
A6 chan=INITIATE("MSACCESS","system")
A7 =APP.ACTIVATE("Microsoft Access",FALSE)
A8 =EXECUTE(chan,"[QUIT]")
A9 =TERMINATE(chan)
A10 =APP.ACTIVATE(FALSE)
A11 =RETURN()
Sub OleAccess()
Dim appAccess as Object
Set appAccess = GetObject(, "Access.Application")
appAccess.Quit acSave
End Sub
For more information about the Quit method, search the Help Index for "Quit
method," or ask the Microsoft Access 97 Office Assistant.
For more information about using macro actions in DDE, please see the
following article here in the Microsoft Knowledge Base:
Q97776 ACC: Running a MS Access Macro from Visual Basic Using DDE
Additional query words: ole/dde server
Keywords : kbinterop kbdta AccCon IntpOlea KbVBA
Version : WINDOWS:1.1,2.0,7.0,97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: August 2, 1999