Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are a very sexy little man... and I mean this in a totally non-gay
way!! :-) Thank you muchly!! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can't quit excel | Excel Discussion (Misc queries) | |||
Formulas quit--- | Excel Worksheet Functions | |||
Workbook.Quit | Excel Programming | |||
Can't get Excel to quit | Excel Programming | |||
Quit Application | Excel Programming |