The following procedure closes the entire Excel application:
Sub CloseApplication() Application.Quit End Sub

Explanation:
- The Quit() method of the Application object is called.
- This method closes Excel completely, including all open workbooks, the Visual Basic Editor (VBE), and the Excel Help window.
- If any workbook has unsaved changes, Excel will prompt the user to save those changes before closing, as shown in Figure 6.10.