-3

I am running Office 365 on both Windows 11. I am trying to totally close an Excel program from VBA. I tried Workbooks.Close and also ActiveWindow.Close in both instances I still have an Excel program running with no file open. How do I basically do the same thing from VBA as I would manually press the X on the upper right to close the whole thing?

0

1 Answer 1

0

To completely close Excel from VBA, including the application itself, not just the workbook, you need to use the Application.Quit:

Sub CloseExcelCompletely()
    Application.Quit
End Sub
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.