Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks! Awesome group. I put out a simple question in the access/vba forum that I couldn't find answered on technet or anywhere else on the web and it was answered the same day!!..."

Geography

Where in the world do Tek-Tips members come from?
vzachin (TechnicalUser)
28 Oct 08 7:38
hi,

the following code is from the Help files but it doesn't always seem to return the correct session.
for example,if i open 4 consecutive sessions and i run the code, session 4 would show as the active session.
then if i do one transaction (sendkey) in session, and run the code again, it would still show session 4 as the active session.
only after several transactions (sendkeys) would the code show correctly as session 1.
the sendkey can be an enter or pf1..etc...
i'm  using myExtra Enterprise 7.11v
any ideas?

thanks
zach

CODE

Sub main()
    Dim Sys As Object, Sess As Object
    Set Sys = CreateObject("EXTRA.System")
' Assumes an open session
    Set Sess = Sys.ActiveSession
    SessionName$ = Sess.Name
    MsgBox "The active session is " + SessionName$ + "."
End Sub
JamesDSM50328 (TechnicalUser)
17 Nov 08 16:12
Are you trying to detrime which window the code is executing from?
vzachin (TechnicalUser)
18 Nov 08 8:36
hi,

here is my dilema
if i have multiple screens open, i can only work in one session at a time. the remaining open sessions will eventually time out (30 minutes) if i don't do something in the session.
what i want to do is run a timed script to evoke a sendkey (maybe an enter or Pf key) in each of the other sessions that are currently inactive.
but i need to be able to figure out which session i'm active in.

i can be active in any session at any given time...
the above code in my original post doesn't work 100%..

any ideas?
zach
SkipVought (Programmer)
18 Nov 08 8:53
Hi,

Since sessions is a collection of session objects, why even bother with activesession?  You can "work" in any session that is in the collection.

CODE

for i = 1 to oSys.Sessions.count
   msgbox oSys.Sessions(1).name
next
 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close