Kill dead instances of Excel on a server
Your code appears to be correct - however, this can be dangerous because it will kill ALL instances of Excel that are running so you run the risk of killing one of your currently running legacy programs.  There are proper ways to clean up Excel resources - see my question here for a C# version.  Do you have any ability to update the legacy programs?  If so, I would recommend that over this.