View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.programming
Clif McIrvin[_3_] Clif McIrvin[_3_] is offline
external usenet poster
 
Posts: 203
Default activating windows

"GS" wrote in message
...
Clif McIrvin wrote :
None that I've ever read about. If he is using multiple instances,
his solution will be much, much easier to find if he can change the
operating model to run all the windows out of a single instance.


Maybe, then, I don't understand what Matthew's talking about! I'm
assuming he's looking for the Application.Window holding the workbook
he's looking for, NOT the OS's open windows of Excel instances. If the
latter is the case then that requires using APIs to query the open
windows. That I can do (returns window handle) but I don't read his
post as this being the case. Perhaps we need more explicit info so we
don't go wondering off on tangents due to assumptions.

The OP clearly states he's looking to "activate a window containing
data to copy from". If the instance of Excel running the code I posted
has multiple files open AND one of those files contains the search
text he's looking for then it will return that window's Caption. I
could have made the function return its Index, but either can be used
to identify the window and so I went with the Caption since that's
what contains the search string.



Absolutely. That's why, when he said your code wasn't working for him,
I questioned whether or not he had multiple instances. The casual
observer would have no idea whether they were running multiple instances
or not.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)