Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Messgae Box on Exit Application

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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Messgae Box on Exit Application

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.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"patterson_m" wrote in message
...
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run macro on exit Steve Excel Discussion (Misc queries) 12 October 25th 09 01:43 PM
Exit Sub Jeff Excel Discussion (Misc queries) 2 March 1st 08 06:21 PM
Run when exit PH NEWS Excel Worksheet Functions 1 July 18th 06 03:53 PM
Excel 2003 - the "X" to exit the application option is greyed out. msiegert Excel Discussion (Misc queries) 5 April 19th 05 11:56 PM
Close or Exit application Jeff[_20_] Excel Programming 0 September 8th 03 03:18 PM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"