Close AUTOMATION Process
-
I use automation to launch Excel, it's work but i don't know how do you do to close Excel process. I use CLSIDFromProgID and GetActive Object to start excel automation. I search a exemple to close automation. Thanks Jerome
-
I use automation to launch Excel, it's work but i don't know how do you do to close Excel process. I use CLSIDFromProgID and GetActive Object to start excel automation. I search a exemple to close automation. Thanks Jerome
In order to attach to Excel, you will have called CreateDispatch() and/or AttachDispatch(). There is a corresponding function ReleaseDispatch() which you can call when you do not need the interface open any longer. Alternatively, you could use the second parameter of
void AttachDispatch( LPDISPATCH lpDispatch, BOOL bAutoRelease = TRUE )
to autorelease the interface for you. Note that Excel, or any other automaton, will not close until all the attached interfaces have been released.