Hi,
I am currently using an excel VBA to activate an open session and sendkeys.
The problem I have is that the code opens the last session that was open and not the session i want.
(Here is the Code) ....
-----------------------------------------------------
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
If (System Is Nothing) Then
MsgBox "error1"
Stop
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "error2"
Stop
End If
Dim Sess0 As Object
SessName0$ = "Dice.EDP"
Set Sess0 = System.activesession
If (Sess0 Is Nothing) Then
MsgBox "error3"
Stop
End If
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.SendKeys ("Hello")
-----------------------------------------------------
The session I want to use is called "Dis" however the last session opened on the system is "MAINFRAME" and I want to sendkeys to "Dis"
Is there anyway I can tell VB to deal with "Dis" and NOT "MAINFRAME" as the ' System.activesession ' part of the code takes you to the "MAINFRAME" session as this was the last opened session.
Any help greatly appreciated.
Gaz.
I am currently using an excel VBA to activate an open session and sendkeys.
The problem I have is that the code opens the last session that was open and not the session i want.
(Here is the Code) ....
-----------------------------------------------------
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
If (System Is Nothing) Then
MsgBox "error1"
Stop
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "error2"
Stop
End If
Dim Sess0 As Object
SessName0$ = "Dice.EDP"
Set Sess0 = System.activesession
If (Sess0 Is Nothing) Then
MsgBox "error3"
Stop
End If
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.SendKeys ("Hello")
-----------------------------------------------------
The session I want to use is called "Dis" however the last session opened on the system is "MAINFRAME" and I want to sendkeys to "Dis"
Is there anyway I can tell VB to deal with "Dis" and NOT "MAINFRAME" as the ' System.activesession ' part of the code takes you to the "MAINFRAME" session as this was the last opened session.
Any help greatly appreciated.
Gaz.