Though I didn't have a macro to run, I had some procedures to run on DB exit.
The way I did it was to define an opening (startup) form as a "splash screen" for my DB. I turned off the Access "close" buttons for the form and instead put a Close button on the form using the wizard. But instead of actually closing the form, I just minimized it and made it invisible. Requires a little bit of VBA code, but not much.
In that form's OnExit event routine, I ran the code I wanted to run. So what happens if someone exits Access is that first all the open forms run their OnExit code. You could even stop the exit operation from at least one of the event routines, I forget which one at the moment. (This posting is kind of "shooting from the hip".)
The only time the code doesn't run is if someone crashes their system while Access is still open. But that is a relatively rare occurrence, so it works pretty well. I would guess you could run your macro there?