I had similar probelm with Excel...

You can do like i did, something like when start the process get the process id, and when you want quit, after saving and done everything you need, just call the kill method of the process...