Application.Quit

B

BillCPA

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?
 
G

Gary''s Student

Once you close the workbook, the macro stops working, so the Quit command is
not even executed.
 

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