| |
chappaai
Posts: 1
Score: 0
Joined: 10/22/2008
Status: offline
|
VBScript on Windows XP I don't know if it's possible, but it seems as though it should be. I can get all the process id's for a given application (for example, multiple Excel sessions) with... GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_Process Where Name = 'excel.exe'") ...and then by looping through the collection's ProcessId properties I can get a unique process id for each running Excel session. But how can I use that information to get a handle to the application and thus access its object model? GetObject(,"Excel.Application") ...will return an (arbitrary?) instance of the application, but not necessarily the one I'm interested in. By looping through the process id's I should be able to find the instance which meets a particular condition and set a handle to it, but I can't find a way to translate the process id into something compatible with GetObject. Am I trying to graft wings onto a pig here?
|
|