Is it possible to create a batch that forces all running instances of excel to close without saving any changes?
I ask because we have several VB.net
programs and VBA
programs that occasionally leave excel open (invisibly) when they error and these instances can interfere with future procedures and slow down performance.
The quickest way to close all open workbooks is to hold the Shift key while pressing the Close Window button. The Close Window button is the “x” in the top-right corner of the application window. If all of the open workbooks have been saved, then they will all be closed.
If you would like to close all workbooks that are open, as well as Excel itself, the shortcut that will achieve this is Alt + F4.
To do this, the general rule is to simply press the Esc key. This should cancel any command or action that Excel is processing.
Right-click the program's icon in the system tray (next to the clock), and choose Close, Exit, or Disable.
I suppose you might be able to do it using the TaskKill tool with a syntax similar to:
taskkill /f /im Excel.exe
However, the proper solution would be to ask the developers of the VB.Net and VBA apps to close down Excel properly when they're finished with them (there are questions/answers here on SO describing how to make sure that it's closed down nicely if they don't know how).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With