On-line search for a long time have no results, the same problem is quite a lot, are not resolved, and some end process to solve the way. Although I did not completely solve, but may be able to help meet the same problem of friends, the operation of Excel in the thread is not a problem, the process of the completion of the threads will be exited, of course, in-line add:: CoInitialize (NULL),:: CoUninitialize () To initialize the thread COM library, what if it's not a thread? For example, in a button event, the problem is that in this case, the Excel process will be clicked one more time, the event execution end process will not exit. The way I do this is to add a WM_CLOSE message:: CoUninitialize (), so although the surface seems to be executed one more process, but in the exit will be all the Excel process exits, some people say this still use you say Ah! And listen to me go on, I used the DoModal (), in this interface added a button event within the save Excel, without adding: couninitialize () in case of closing DoModal (), the Excel process will not quit, Excel will not exit after the entire program is exited, and when DoModal () is closed add:: CoUninitialize (), close DoModal () will exit the Excel process created in DoModal (), no matter how many will exit. If you want to exit Excel after executing the code, then it is recommended that you use threads to do it! If there is a better way to quit Excel without using a thread, you can tell me!
About VC Operations Excel cannot quit a process issue