Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Looping Through Every Instance of Excel

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Looping Through Every Instance of Excel

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Looping Through Every Instance of Excel

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".

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Looping Through Every Instance of Excel

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".



  #5   Report Post  
Posted to microsoft.public.excel.programming
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".







  #6   Report Post  
Posted to microsoft.public.excel.programming
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - New Instance JMay Excel Discussion (Misc queries) 4 November 28th 09 04:55 PM
How do I get one instance of Excel to communicate with another instance? [email protected] Excel Programming 3 November 21st 06 10:31 PM
How to get all Excel instance Xav[_2_] Excel Programming 2 December 24th 05 04:55 PM
Excel Instance FuzzyLogic Excel Programming 2 February 21st 04 03:41 PM
Second instance of Excel Dom[_2_] Excel Programming 1 August 25th 03 05:37 PM


All times are GMT +1. The time now is 10:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"