in reply to Really stop WIN32 OLE application

If undef does not work for you get a sledgehammer and try Win32::KillProcess. This has yet to make CPAN but with it you can just:

use Win32::KillProcess ':all'; $c = connectServer(); my @pids = getProcessPids( $c, 'excel.exe' ); killProcess( $c, @pids );

Outlook is one program that seems to leave instances lurking about even when you really try to do the right thing.

cheers

tachyon

Replies are listed 'Best First'.
Re: Re: Really stop WIN32 OLE application
by Grygonos (Chaplain) on Apr 05, 2004 at 14:56 UTC
    just a note about the killing of processes this way.. it will kill all your instances of excel.exe if i'm reading it correctly... so you might want to try and find a method of getting the pid of the specific excel.exe that was created by your script....just a note..., undeffing it does also work.

    Grygonos

      Did I mention it was like using a sledge hammer to crack a Walnut? :-)

      cheers

      tachyon