sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,404
- Office Version
- 2016
- Platform
- Windows
I'm currently using this to close a workbook;
This leaves an instance of Excel running which I know can be resolved by using Application.Quit. My questions is though when I've used that in the past it closes every Excel workbook that is open when in fact all I want is the active one closed, so is there a way I can get it to quit Excel if it detects that I only have 1 active workbook?
Code:
ActiveWorkbook.Close SaveChanges:=True
This leaves an instance of Excel running which I know can be resolved by using Application.Quit. My questions is though when I've used that in the past it closes every Excel workbook that is open when in fact all I want is the active one closed, so is there a way I can get it to quit Excel if it detects that I only have 1 active workbook?