Completely Exit Excel Macro

G

Guest

How do I get Excel to actually completely exit? Below is the code I'm trying
to use but when it gets to the close portion, it only closes the workbook and
Excel is still running/opened.

DoFinishing = MsgBox("All Done With Updates... Save Spreadsheet and
Exit?", vbYesNo)
If DoFinishing = vbNo Then
DoSave = MsgBox("Then Do You Want To Save The Spreadsheet?", vbYesNo)
If DoSave = vbNo Then
Exit Sub
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.DisplayAlerts = True
Exit Sub
End If
Else
Application.DisplayAlerts = False
Application.Workbooks("! Compiled.xls").Save
Application.Workbooks("! Compiled.xls").Close
Application.DisplayAlerts = True
End If

Thanks,
R
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top