There is no specific event for the application closing. How does the
user close the application? Do they click on a button on a form? If
so, you could attach your macro to the On Click event property of this
button, prior to the Quit action. Or, if this is a form which is always
open whenever the application is open, you could use the On Unload event
property of the form.