in reply to Get PID of a particular instance of Excel

When you are using Win32::OLE like this Perl is not opening Excel, it is asking the OLE sub system to open it on its behalf. You don't need to and infact shouldn't know the PID of the Excel instance, it could be that the Excel is being used by more than one program or is being run as a user different to the one that is running your program. I think you are looking at some problem with a preconceived notion of how it needs to be addressed - maybe if you started from the beginning and explained what problem it is that you are trying to solve we might be able to help you more.

/J\

  • Comment on Re: Get PID of a particular instance of Excel

Replies are listed 'Best First'.
Re^2: Get PID of a particular instance of Excel
by Nalina (Monk) on Jun 09, 2005 at 10:24 UTC
    As I said in my last thread, I have an ASP page running on the remote server. This ASP uses the Shell object to run the Perl script as a process and wait for its completion? This Perl Script inturn uses OLE to open excel file & create graph. Different users from different hosts access this ASP page & try to create graphs. Now the problem is when 2 or more users try to generate graph simultaneously, the excel file opened by perl is not getting closed. Over a period of time there will be many instances of excel in the task manager. So I just need to find out what session has opened Excel.exe in task manager, get its pid & then kill it. I am trying this since a week. Kindly help.