Hi there
What I'm trying to do is 1) to check if a certain workbook is open in any running xlInstance (I've resolved that), 2) and then hook to that perticular xlInstance and open another workbook in it, and 3) finally make that xlInstance active (I've resolved that part too).
But how do I get an object pointer to that perticular xlInstance?
I know how to collect Window Handles to all running Excel Instances. But what I don't know is how to get the Application object from these Window Handles.
GetObject won't do because I've got zero control of what Excel instance is returned.
I've found some information about a Windows API Function called AccessibleObjectFromWindow. I've tried to use it but I'm failing to get the arguments right. The problem seems to be the 3rd argument. I just don't get it. Examples I've found seem to use it "differently" from case to case, and I can't find any details (or should I say, any details I understand) to resolve the problem.
Please, can anyone help med with this? Or is there a better way to get the Excel Instance from the Window Handle?
Your truly. PeSi
What I'm trying to do is 1) to check if a certain workbook is open in any running xlInstance (I've resolved that), 2) and then hook to that perticular xlInstance and open another workbook in it, and 3) finally make that xlInstance active (I've resolved that part too).
But how do I get an object pointer to that perticular xlInstance?
I know how to collect Window Handles to all running Excel Instances. But what I don't know is how to get the Application object from these Window Handles.
GetObject won't do because I've got zero control of what Excel instance is returned.
I've found some information about a Windows API Function called AccessibleObjectFromWindow. I've tried to use it but I'm failing to get the arguments right. The problem seems to be the 3rd argument. I just don't get it. Examples I've found seem to use it "differently" from case to case, and I can't find any details (or should I say, any details I understand) to resolve the problem.
Please, can anyone help med with this? Or is there a better way to get the Excel Instance from the Window Handle?
Your truly. PeSi