Roo,
I've also tried commenting out the "...do stuff here..." so that I go directly from the CREATEoleOBJECT to XLap.QUIT and still have the EXCEL.EXE process left over. Also, when debugging, I'm definitely executing the closing statements. And I've checked that the debugging environment is suitable to close the roque EXCEL.EXE Process by demonstrating that in a simple test problem.
I have another program that automates XL that doesn't do this and also a little test program that doesn't do this.
I'm in the process of single stepping through the closing statements to compare the steps taken through the system and assembler code to see what is different.
I have already done this and there is a different path taken, however, that path is so complicated, I'm going to have to log it for both cases (ugh) and hope that it will reveal the problem.
__________________
Also, this troublesome program is around 3000 lines long and there are 2 other subsequent XL automations. Since I am debugging the 1st automation, I was hoping that anything downstream would be of no importance, however, I'm not sure of that.
____________________
I'm also wondering about the tree structure of Procs and Funcs that involve XL and how EXCEL97, COMOBJ, and OLESERV are ordered in the USES statements. So far, a few changes have not solved problem.
_____________________
I keep thinking of changes to try but I am quickly coming to the end of ideas which will leave only the brute force method where I start building a copy of the program, step by step, until I hit the snag that causes this problem. I am not looking forward to that.
Thanks for you input.