I try to open and modify an Excel document with a Perl script, and I want this document to be still open after. I use the following code :
unless (defined $ex) {
$ex = Win32::OLE->new('Excel.Application', sub{$_[0]->Quit;})
or die "Cannot start Excel";
}
$ex->{Visible} = 1;
The Excel document briefly appears, then vanishes. The work is correctly done, but Excel closes down after. Is there a way to keep Excel open?
Just remove your destructor construct from the new method: