View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
papou[_9_] papou[_9_] is offline
external usenet poster
 
Posts: 52
Default Auto Close and Save

Hi Scott
Sub CloseFileAndExit()
ThisWorkBook.Close(True) 'Or false if you do not wish to save (since you did
not mention)
Application.Quit
End Sub

Sub SaveAndClose()
Do While Application.Dialogs(xlDialogSaveAs).Show = False
Loop
ThisWorkbook.Close
Application.Quit
End Sub

HTH
Cordially
Pascal


"scottwilsonx " a écrit dans
le message de ...
Hi everyone. Hopefully this is an easy question to answer:

I want to set an automatic macro to close the file and exit excel.

I also want another one, which prompts the user to save the file and
then close.

Any ideas ?

Thanks
Scott.


---
Message posted from http://www.ExcelForum.com/