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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disconnect Session

Status
Not open for further replies.

SkipVought

Programmer
Dec 4, 2001
47,485
7
38
US
I am running VBA in Excel, an unattended process, where I create an Extra System object, a session, a screen, log in to an IMS session on the mainframe, do stuff, then...

here's where I am experiencing my "opportunity."

When I
Code:
    oSystem.Quit
I get a 'Yes/No' message box...
Extra!Personal Client
Do you want to disconnect session 'session name'?
How can I dispose of this message via code?


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I posted in Forum707 as well, since I am running VBA.

I got a response from DaveInIowa that helped me to solve this problem, thread707-1519452.

Make the SESSION Visible property FALSE.
Then Quit the System object.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Could you share the code you use to launch extra, load a session, execute a macro, and how you closed it?
 
Code:
sub Main()
    IMS_Login
    
    Step2

    oSess.Visible = False
    oSystem.Quit
    Set oScrn = Nothing
    Set oSess = Nothing
    Set oSystem = Nothing
End sub
Sub IMS_Login(Optional bContinue As Boolean = True)
    

    Dim bLogin As Boolean
    
    Set oSystem = CreateObject("Extra.System")
    
    sPath = "C:\Program Files\E!PC\65Backup\Sessions"
    sFile = "MVSB1 Session1.EDP"
    
    If oSystem.Sessions.Count = 0 Then
        Set oSess = oSystem.Sessions.Open(sPath & "\" & sFile)
'        ufmPassword.Show
        bLogin = True
    Else
        Set oSess = oSystem.ActiveSession
        bLogin = False
    End If
    
    With oSess
        .Visible = True
        .WindowState = xNORMAL
    End With

    Set oScrn = oSess.Screen
    If (oScrn Is Nothing) Then GoTo ExitMacro
    
    oSystem.TimeoutValue = 100
    
    With oScrn
        If bLogin Then
        ' BHT SignOn
            Do Until .WaitForCursor(17, 28)
                DoEvents
            Loop
            .Area(17, 28, 17, 28) = "S"
            .SendKeys ("<ENTER>")
        ' Login
            Do Until .WaitForCursor(14, 37)
                DoEvents
            Loop
            .Area(14, 37, 14, 46) = fOSUserName()
            .Area(15, 37, 15, 46) = vPassword
            .SendKeys ("<ENTER>")
        ' SuperSession
            Do Until .WaitForCursor(9, 2)
                DoEvents
            Loop
            .Area(11, 2, 11, 2) = "S"
            .SendKeys ("<ENTER>")
        ' IMS Ready
        End If
    End With

ExitMacro:
    If bContinue Then Exit Sub
    Set oScrn = Nothing
    Set oSess = Nothing
    Set oSystem = Nothing
End Sub


Skip,
[sup][glasses]Don't let the [b]Diatribe[/b]...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
[b]for a NUANCE![/b][tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top