Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specific Session not available

Status
Not open for further replies.

JamesDSM50328

Technical User
Mar 25, 2005
33
US
Hi I'am having an issue I am running a possible 6 sessions that I will be flipping between and to scrape info from.
I keep on getting an error that the Specified session is not available error -2147200922(80040200)
Code:
ReDim s(1 To Sessions.Count)
For sess = 1 To Sessions.Count
s(sess) = Sessions.Item(sess).Name
If StrComp(Sessions.Item(sess).Name, "Extra", vbTextCompare) = 0 Then Exit For
Next sess
For i = 1 To Sessions.Count
Do While Sessions(s(i)).Connected <> 1
   
    DoEvents
Loop

I'm just trying with 2 sessions now.
the name of the possibe sessions could vary depending on the selections they chose.
in the array the s(i) is picking up the session names of CPI1 and CPI3 but it is erroring on the Do while line.
Any help would be greatly appreciated.

THANKS
 
My guess is your not getting the expected result from Sessions.Count

With two seeeions open what does

msgbx Sessions.Count

tell you

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
and possibly Sessions.Count index begins with 0 being the first session.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks MrWilson for your response, i think I found a solution for some reason it did like sessions.item(sess).name but it worked once i had the path\name.edp
Code:
ReDim s(1 To Sessions.Count)
For sess = 1 To Sessions.Count
s(sess) = Sessions.Item(sess).Path & "\" & Sessions.Item(sess).Name & ".edp"

Next sess
For i = 1 To Sessions.Count
Do While Sessions(s(i)).Connected = False
    Debug.Print s(i)
    DoEvents
Loop

Next i

Unless someone can come up with a better solution or tell me where it is wrong, but it seems to work fine.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top