Visible Instances of an Application
Hello All,
I am building something that needs to grab a certain instance of MS Excel.
Unfortunately, "GetObject" randomly chooses an instance and, therefore, is
not appropriate / robust enough by itself. In pseudo code, what I need is
below:
For each pProcess in Processes
If instr(pProcess.Name, "Excel") 0 And pProcess.Visible = True
Then
Set MyAppInstance = pProcess.Instance
Exit For
End If
Next pProcess
Thanks & Regards,
TC
|