ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application.Quit (https://www.excelbanter.com/excel-programming/418860-application-quit.html)

BillCPA

Application.Quit
 
I have the following code behind a command button on a user form. The object
is to close the workbook and then quit Excel.

KOMenu.Hide
Application.StatusBar = False
Application.ScreenUpdating = True
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Close Savechanges:=False
Application.Quit

It closes the workbook but Excel itself stays open. If I take out the
..Close statement, it quits Excel correctly. Any suggestions on why this
might happening?

--
Bill @ UAMS

Gary''s Student

Application.Quit
 
Once you close the workbook, the macro stops working, so the Quit command is
not even executed.
--
Gary''s Student - gsnu200809


"BillCPA" wrote:

I have the following code behind a command button on a user form. The object
is to close the workbook and then quit Excel.

KOMenu.Hide
Application.StatusBar = False
Application.ScreenUpdating = True
ActiveWindow.WindowState = xlMaximized
ActiveWorkbook.Close Savechanges:=False
Application.Quit

It closes the workbook but Excel itself stays open. If I take out the
.Close statement, it quits Excel correctly. Any suggestions on why this
might happening?

--
Bill @ UAMS



All times are GMT +1. The time now is 10:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com