philip
philip

Reputation: 365

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.

Upvotes: 8

Views: 15692

Answers (1)

Hans Olsson
Hans Olsson

Reputation: 55009

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

Upvotes: 14

Related Questions