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!

Active session issues

Status
Not open for further replies.

JamesDSM50328

Technical User
Mar 25, 2005
33
US
I am working on a macro that needs to fire accross the active session. The people using the macro could have 3+ sessions open.
Is there a way to make sure the macro fires accross the session that is currently the activated window of attachmate?

Any help would be greatly appreciated.
THANKS
 
Set objExtra = CreateObject("EXTRA.System")
Set objSession = objExtra.ActiveSession
 
Thanks Skie,
When using that, it seems that it is not using the active windowed session, it is using the last session opened.

Any other ideas
 
You can list the sessions in a loop. As I recall, Active Session will default to the last opened session.

This is inside a VB form, but you'll see how to loop through them.

For i = 1 To Sessions.Count
lstSelectSession.AddItem (Sessions.Item(i).Name)
Next i

calculus
 
Thanks, I think I found something that works so far...
Code:
Dim System As ExtraSystem
Dim Session As ExtraSessions
Dim Sess0 As ExtraSession

Set System = CreateObject("Extra.System")
Set Session = System.Sessions
sess = System.ActiveWindow
Set Sess0 = System.Sessions(sess)

So far it always executes from the session that the macro fires from.
does anybody see anything that might go wrong with this?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top