in reply to Re: Problem opening Excel file using Win32::OLE
in thread Problem opening Excel file using Win32::OLE
#my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); # use the +Excel application if it's open, otherwise open new
Also, try using the following code which I grabbed from the ActivePerl User Guide to
check to see if Excel is already running(obviously replacing with your filename variables):
# use existing instance if Excel is already running eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')}; die "Excel not installed" if $@; unless (defined $ex) { $ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Qui +t;}) or die "Oops, cannot start Excel"; }
|
|---|