#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Quit

OK- so here's my code

Sub quit()
'
'

result = MsgBox("Did you mean to press the 'QUIT' Button?", _
vbYesNoCancel, "QUIT")
If result = vbYes Then
GoTo continue1
Else
MsgBox "Cancelled", vbOKOnly, "QUIT"
GoTo exit1
End If

continue1:

Application.DisplayAlerts = False
Application.quit
Application.DisplayAlerts = True

exit1:

'
End Sub


Anyone know why it still asks me if I want to save changes?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Quit

Quit is the same as if you quit from the main application menu - an unsaved
workbook will result in the question being asked from a procedure within
VBA.

Use the following line before the quit command.

ThisWorkbook.Saved = True

you might like to simplify you code to this......

Sub quit()
If MsgBox("Did you mean to press the 'QUIT' Button?", _
vbYesNoCancel, "QUIT") = vbYes Then
Application.DisplayAlerts = False
ThisWorkbook.Saved = True
Application.quit
Application.DisplayAlerts = True
Else
MsgBox "Cancelled", vbOKOnly, "QUIT"
End If
End Sub


--
Cheers
Nigel



"solomon_monkey" wrote in message
oups.com...
OK- so here's my code

Sub quit()
'
'

result = MsgBox("Did you mean to press the 'QUIT' Button?", _
vbYesNoCancel, "QUIT")
If result = vbYes Then
GoTo continue1
Else
MsgBox "Cancelled", vbOKOnly, "QUIT"
GoTo exit1
End If

continue1:

Application.DisplayAlerts = False
Application.quit
Application.DisplayAlerts = True

exit1:

'
End Sub


Anyone know why it still asks me if I want to save changes?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Quit

You are a very sexy little man... and I mean this in a totally non-gay
way!! :-)

Thank you muchly!!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Quit

"solomon_monkey" wrote in message
oups.com...
You are a very sexy little man... and I mean this in a totally non-gay
way!! :-)

Thank you muchly!!

'------------------------------------------------

I find your response to Nigel outrageous: you ask for help and feel it
appropriate to respond in the manner that you have to someone who has
manifestly SOUGHT to assist you!



I would urge you to drop the second part of you appellation because it is
clearly an aspiration too far in your case.



I have no problem with polemic or intelligent invective - indeed either can
be stimulating - but such mind-numbing , fatuous imbecility is asking too
much - even of me.



Shame on you!



I am, however, ineluctably drawn to your prophetic choice of post subject
line: Quit.



Quit? Were you only to take you own advice, I would grieve very little.



I do not seek confrontation, but I am not prepared to subjugate principles
to avoid it.



You are, however, lucky in one small respect - I am in a very good mood
today.



To others in group, I ask to excuse my intemperate, castigatory outburst,
but I had hoped that someone would have made my intervention unnecessary;
in the final analysis, I would have felt diminished and demeaned had I not
responded.



I do not seek confrontation, but I am not prepared *not* to evince my
principles to avoid it



PS: I know nothing of Nigel and have no special axe to grind on his behalf.


---
Regards,
Norman




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Quit

Wow! - I just found it amusing. I hope the OP got what he wanted. No
offence taken!

--
Cheers
Nigel



"Norman Jones" wrote in message
...
"solomon_monkey" wrote in message
oups.com...
You are a very sexy little man... and I mean this in a totally non-gay
way!! :-)

Thank you muchly!!

'------------------------------------------------

I find your response to Nigel outrageous: you ask for help and feel it
appropriate to respond in the manner that you have to someone who has
manifestly SOUGHT to assist you!



I would urge you to drop the second part of you appellation because it is
clearly an aspiration too far in your case.



I have no problem with polemic or intelligent invective - indeed either

can
be stimulating - but such mind-numbing , fatuous imbecility is asking

too
much - even of me.



Shame on you!



I am, however, ineluctably drawn to your prophetic choice of post

subject
line: Quit.



Quit? Were you only to take you own advice, I would grieve very little.



I do not seek confrontation, but I am not prepared to subjugate

principles
to avoid it.



You are, however, lucky in one small respect - I am in a very good mood
today.



To others in group, I ask to excuse my intemperate, castigatory

outburst,
but I had hoped that someone would have made my intervention

unnecessary;
in the final analysis, I would have felt diminished and demeaned had I not
responded.



I do not seek confrontation, but I am not prepared *not* to evince my
principles to avoid it



PS: I know nothing of Nigel and have no special axe to grind on his

behalf.


---
Regards,
Norman








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Quit

I am entirely relieved you took it in the light hearted manner it was
intended Nigel. Thanks. I did get what I wanted. All good. If anyone
was offended then I'm very sorry I guess.

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
can't quit excel maven Excel Discussion (Misc queries) 0 March 15th 07 12:31 AM
Formulas quit--- FangYR Excel Worksheet Functions 1 February 11th 06 01:37 PM
Workbook.Quit Ronbo Excel Programming 2 January 7th 05 03:07 AM
Can't get Excel to quit Todd Waldron Excel Programming 10 November 22nd 03 03:19 PM
Quit Application Robert Black Excel Programming 1 July 31st 03 04:15 PM


All times are GMT +1. The time now is 11:52 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"