View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Looping Through Every Instance of Excel

Yes I have described how I do it once or twice!

Recently in this ng Rama posted a link to this approach to populate a
collection of Excel instances which works very well indeed -
http://www.mrexcel.com/board2/viewto...37277&start=10

As written it doesn't necessarily catch all instances, in contrast to my
rather more clunky method which normally does.

Regards,
Peter T

"NickHK" wrote in message
...
Maybe this will get you started:
http://vbnet.mvps.org/code/system/fi...likesimple.htm

Peter T has a some posts on this subject in this NG. Search through

Google.

NickHK

wrote in message
ups.com...
On Mar 5, 9:17 am, Tom Ogilvy
wrote:
some have suggested:

set xlapp=getobject(,"fully qualified workbookname").Parent

--
Regards,
Tom Ogilvy



" wrote:
Hello,
I want to loop through every instance of excel and find an open
workbook, I tried this:

For i = 1 To app.workbooks.Count + 1
z = app.workbooks(i).Name
If InStr(app.workbooks(i).Name, "STXL") Then
WB_Found = True
Exit For
End If
Next

Unfortunately, this only finds the open workbooks within each
individual instance. Is this even possible?

Clay- Hide quoted text -

- Show quoted text -


I don't know the name of the excel workbook, only that the name
contains "STXL".