Seem’s like this ought to be easy, but I’m stuck…
I’d like to execute some VBA code (to restore some application settings I changed at startup) when the user exits the program — I want to make sure it gets run regardless of the method they use to quit the application (File…Exit, X control on the application window, right-click-close on the Task Bar, etc.). This would be analogous to the autoexec macro for startup (except for shutdown) or the Workbook_BeforeClose() event in Excel.
Is there a way to do this?