After the user clicks the Close Excel command button, the CloseExcel subroutine is called, as shown in Listing 22.5. The subroutine first checks to see whether the gobjExcel object variable is still set. If it is, Excel is still running. The DisplayAlerts property of the Excel application object is set to False. This ensures that, when the Quit method is executed, Excel will not warn about any unsaved worksheets. This methodology is acceptable because all work was accomplished using a new instance of the Excel application object. If you want to save your work, you should execute the required code before the Quit method is executed.