Quote Originally Posted by XL-Dennis
THe OP's code does not create a second instance of Excel but as You can see the following snippet code does not close the created instance of Excel:
I wasn?t so willing to make that assumption after in post #4 he said that he didn?t paste all of the code. In post #10 he wrote ?that's why I know that it is reaching the end of the code?, which is why I asked for him to explicitly say that it was reaching the line with ex2.quit, because I had already expressed the need for different error handling and already said that an error occurring before ex2.quit would cause it not to quit.

Quote Originally Posted by XL-Dennis
So the OP needs a better basic error handling which I thought You should had been able to track down
From my very first response I?ve been advocating exactly that. In post #2 I wrote: ?Perhaps you had created them in your code but got an error that prevented .quit from executing? On good rule of thumb is when automating other apps in office, always use an error handler that cleans up by either making them visible or quiting things that are open.?

In post #9 I wrote: ?If the code it stopped for any reason before it has a chance to make it to the end of the procedure, then Excel won't quit.?

and also...

?As a matter of practice, however, I'd recommend adding error handling for the procedure as a whole so that any unhandled errors go to the error handler where things are cleaned up.?