Jay said:
: I need to determine if Excel is running and if so close it. Can this be done
: with a Perl script and can someone suggest an approach to do it.
#!perl
use warnings;
use strict;
use Win32::OLE;
while(
my $excel =
Win32::OLE ->GetActiveObject('Excel.Application')
) {
$excel ->Quit
}
One might want to include a statement like:
$excel->Application->{DisplayAlerts}='False';
before the ->Quit call if one wishes to ensure Excel actually
shuts down without user intervention (otherwise, one may get a
prompt about saving modified worksheets). This might just apply
to recent versions of Excel (as I recall, a different sequence
was required with Excel 97 and earlier??).