In Excel 2007 VBA, I open two additional workbooks. Their visible property is set to false. There are now three instances of Excel showing in Task Manager even though only one shows in the taskbar. If (or more precisely, when) an error occurs, all three instances are still there. I'd like to create an error handler to kill the two I opened in my code but not the original one that contains my code.
I have seen numerous functions with a signature like "Function KillProcess(ProcessName as string) as Boolean". Of course, all the processes are named EXCEL.EXE. So, I need to kill these processes based on some property other than name -- perhaps process id? I'm not sure how to get the id and then use it to kill the process.
Thanks for your help.
Bookmarks