Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch to force close all excel files

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.

like image 633
philip Avatar asked Feb 02 '11 09:02

philip


People also ask

How do you force close all Excel files at once?

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.

How do you close all Excel files at once with shortcut?

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.

How do you terminate Excel?

To do this, the general rule is to simply press the Esc key. This should cancel any command or action that Excel is processing.

How do I stop Excel from running in the background?

Right-click the program's icon in the system tray (next to the clock), and choose Close, Exit, or Disable.


1 Answers

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).

like image 55
Hans Olsson Avatar answered Oct 15 '22 23:10

Hans Olsson