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

Interacting with Attachmate dialog box at login 1

Status
Not open for further replies.

AlbertShenko

Programmer
Nov 20, 2018
12
0
0
US
I am starting to implement some scripting (in Excel/VBA) to interact with Attachmate EXTRA! X-Treme 9.3.
I can successfully create and open the session and I am able to send keys.

However, while the user name for the connection is stored, the password is not. I receive a dialog box prompting for the password and I have not figured out how to interact with this.
I am able to manually enter the password and resume my code; but how can I do this systematically?

Thanks for any guidance!

Code:
Public oSys As ExtraSystem
Public oSess As ExtraSession
Public oScreen As ExtraScreen
Sub ConnectToAttachmate()
    Set oSys = CreateObject("Extra.System")
    
    If oSys Is Nothing Then
        MsgBox ("Could not create Extra.System...is E!PC installed on this machine?")
        Exit Sub
    End If
    
    If oSys.Sessions.Count = 0 Then
        Set oSess = oSys.Sessions.Open("C:\Users\ashenko\Desktop\apl\test.edp")
    Else
        Set oSess = oSys.Sessions(1)
    End If

    If (oSess Is Nothing) Then
        MsgBox "Could not create the Sessions collection object. Stopping macro playback."
        Stop
    End If

    If Not oSess.Visible Then oSess.Visible = True
End Sub

Sub Main()
    Call ConnectToAttachmate
    
    oSess.Activate
    Set oScreen = oSess.Screen
    oSess.Screen.SendKeys "<Enter>"
End Sub
[img]https://res.cloudinary.com/engineering-com/image/upload/v1542730309/tips/capture_zet9sb.jpg[/img]
 
Hi,

I am starting to implement some scripting (in VBA)

What application are you coding your VBA in?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
My apologies. I am using Excel and interacting with Attachmate EXTRA! X-Treme 9.3
 
Good choice, BTW! Suspected that, but just wanted to be certain.

Just use the control that you’d use in any other circumstance. I’ve use and ActiveX or Forms control, from your Developer menu. I’ve run all my screen scrapers from Excel, since my driver data was in Excel and my results went to Excel for my users and I much prefer to drive a Caddy than a Yugo.

BTW, born and raised in the Keystone State.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
How do I pass this information to the password prompt from Attachmate?
Once I get passed that prompt (manually), I can interact with that session though Excel; but I am unable to figure how to send my password to that popup dialog box (in the screenshot) that Attachmate is bringing up. I am not sure how to set the focus on that rather than the main window.

And sadly, Fall foliage is abandoning us here in PA as the trees are pretty much baron. It was pretty for a few weeks.
 
Hmmmmm?

Never had a pop-up. Always had terminal interface to IBM mainframes where the emulator mimicked a green screen dumb terminal with login fields on screen.

Is there some way to start your session interface with a screen login rather than a control object? You call a startup program puts the control up. There may be another way to call up a screen form.

Not knowing your system, but I recall a [tt]/for[/tt] I believe.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
FAQ707-4594

Using the Watch Window in your VBA Editor, you may be able to find the control and discover the properties.


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
I was able to resolve this today.

For the benefit of others who come across the same problem:

The popup dialog of EXTRA! does not accept SendKeys sent to the ExtraSession object (in my case, called oSess).
However, you can use AppActivate in VBA by referencing the EXTRA! application by name and SendKeys to that to clear the pop-up prompt.

Then from there, you can SendKeys and otherwise interact with the session screen directly (in my case, oSess.Screen.SendKeys) as expected.
 
Great! And thanks for sharing your solution. That’s what Tek-Tips is all about.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top