Nalina has asked for the wisdom of the Perl Monks concerning the following question:
I am opening an excel file & then saving it. Can I get the pid of this excel file opened by passing some reference of it (like $Excel or $Book)? I am trying this since many days. I am really frustrated. Kindly help. Thanks in Advanceuse Win32; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; use Win32::OLE::NLS qw(:LOCALE :DATE); use Win32::OLE; use Win32::OLE::Const; $Win32::OLE::Warn = 3; # die on errors... $Constant = Win32::OLE::Const->Load('Microsoft Excel'); $Excel = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;}) || die "Error launching MS Excel ".Win32::OLE->LastError(1); $Excel->{Visible} = 0; $Book = $Excel->Workbooks->Add; my $filename="C:\\perlscripts\\test.xls"; $Book->SaveAs($filename); $Book->Close({SaveChanges=>0});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get PID of a particular instance of Excel
by Corion (Patriarch) on Jun 09, 2005 at 06:49 UTC | |
by Nalina (Monk) on Jun 09, 2005 at 08:38 UTC | |
|
Re: Get PID of a particular instance of Excel
by gellyfish (Monsignor) on Jun 09, 2005 at 09:03 UTC | |
by Nalina (Monk) on Jun 09, 2005 at 10:24 UTC | |
|
Re: Get PID of a particular instance of Excel
by tchatzi (Acolyte) on Jun 09, 2005 at 10:44 UTC |