VBA6
Is there a way to use some "handle" such that when a user clicks on
the close/exit box in the upper right corner of the main form of a VB6
program, some VBA code (a subroutine) can be called to execute before
the program exits? What is the handle called?
I want to be sure that no matter how a user decides to quit, some
spawned instances of Excel are closed before the VB6 program exits.
The problem generally occurs when a user decides to quit the program
before he has finished making a "run," i.e., he just wants to dump
what he is doing right now and free up the resources -- or even shut
down. If the spawned instances of Excel aren't killed when the
program is exited, they delay the shut down of the Operating System,
as one gets an error message that "Excel.exe is not responding!"
I know how to write the code to kill Excel; I just don't know how to
call it in the instance when the user clicks the close box.
Thanks,
Fred Holmes