View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default activating windows

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.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc