As Arvin Meyer points out, if you have an explicit programmatic reference to
Excel, you must close all workbooks, Quit the object, and set it to Nothing.
If there are other instances of Excel you need to close, you can use
Set objXL=GetObject(,"Excel") ' Warning ... Air code!
then take the same steps with that object.
You can do this in a loop until it throws an error because there are no more
objects to get.
Remember, though, that this procedure will also close any unrelated
instances of Excel which happen to be running on the PC.
Some users might not be too happy to have their other work closed any time
they use your application!
HTH
- Turtle