Messgae Box on Exit Application

  • Thread starter Thread starter patterson_m
  • Start date Start date
P

patterson_m

I want to display a message box when the user 'exits' the application.

Sub Auto_close ()

MsgBox "THANK YOU FOR YOUR FEEDBACK ", vbOKOnly + vbInformation,
"From the Agreement Finance Team"

Application.Quit

End Sub


The problem is that the message box appears twice, each time prompting
the user to click ok.

Any ideas why or how I can stop this.

Thanks

Mark
 
Hi Mark

Get rid of "Application.Quit" in the code and see if it helps. Aplication does not refer
to your app but to Excel herself. Also, you should not use MsgBoxes for things like those,
MsgBoxes require an OK click and if no click then Excel won't close and then Windows won't
close and my laptop runs out of batteries or you won't be in time for dinner or ... You
don't want your team's name on a monster like that.
 
Back
Top