View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
[email protected] bornecw@gmail.com is offline
external usenet poster
 
Posts: 3
Default Looping Through Every Instance of Excel

On Mar 6, 4:45 am, "Peter T" <peter_t@discussions wrote:
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/viewtopic.php?t=237277&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
oups.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".- Hide quoted text -


- Show quoted text -


Thanks everyone this is very helpful.