in reply to Re: Win32-OLE: What is the canonical way to open file for editing?
in thread Win32-OLE: What is the canonical way to open file for editing?
If I understand you correctly I should always use:# use existing instance if Excel is already running unless (defined $excel) { eval { $excel = Win32::OLE->GetActiveObject('Excel.Application') }; die "Excel not installed" if $@; } unless (defined $excel) { $excel = Win32::OLE->new('Excel.Application', 'Quit') or die "Oops, cannot start Excel"; } #to avoid excessive dialogs when saving in non-Excel format $excel->{DisplayAlerts} = 0;
Is that correct?my $excel = Win32::OLE->new('Excel.Application', 'Quit') or die "Oops, cannot start Excel";
at the end of any function. Shouldn't it take care or Excel objects?$excel->Quit(); undef $excel;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Win32-OLE: What is the canonical way to open file for editing?
by davies (Monsignor) on Feb 24, 2016 at 17:57 UTC |