View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_411_] Leith Ross[_411_] is offline
external usenet poster
 
Posts: 1
Default invoke "Save Changes?" prompt


Hello I Beliieve,

Here is macro that recreates the dialog. Another choice would be to add
this into your code...

ActiveWorkbook.Saved = False
Application.Quit

HERE'S THE DIALOG IN MACRO FORM...

Code:
--------------------

Sub SaveChangesPrompt()

Dim Answer

Answer = MsgBox("Do you want to save the changes you made to '" & ActiveWorkbook.Name & "'?", vbExclamation + vbYesNoCancel)

Select Case Answer
Case vbYes
ActiveWorkbook.Save
Case vbNo
ActiveWorkbook.Saved = True
Application.Quit
Case Cancel
Exit Sub
End Select

End Sub

--------------------


Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=495627