application quit closing application, but not excel

  • I have used Application.Quit in all my excel applications. However in this application, excel does not close ( the application does close.. I can't use workbook ("name").close, because the name is not static. I am hoping that one of the VBA Gurus' can figure it out. I have tried moving some of the code around, but no luck. Right now I feel dumb, because I can't figure out this simple problem.

    If I allow the Application.DisplayAlerts then every thing closes.

  • Have you tested with only the one workbook open?

    Prior to Excel 2016, you could have multiple Excel files in a single window. with the introduction of Excel 2016, it is one window per application.

    Your code probably closes an instance of Excel depending how the Excel files were opened.

  • I have one instance of excel running, also this is the same code I have used with the other applications, with out an issue. So I don't have a clue.
    Problem solved. I added Application.EnableEvents = False here is the full code

    I think the issue was that excel was looking for Application.EnableEvents = False. I know that stops code from running. Apparently Excel was running in the background. So I had to stop 2 things 1) I had to stop this instance of excel, 2) I had to close excel in the background. Roy u were on the right track.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!