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

Extra 6.5 freezes/white screen while VBA connection

Status
Not open for further replies.

VictorRavagnani

IS-IT--Management
Oct 7, 2015
12
BR
Hello everyone

Before the update for Office 2013, my macros in vba connectiong with Extra! Client 6.5 was working better than ever. After this update (or something else that i'm not aware), the same macros doesn't.

Eveything was checked:
- reference in VBA
- object creation and assingments

The command that seems to be facing problems is the .WaitForHost(xxx).

Do you guys face the same problem? If so, is there a way to solve this out?

Thank you and have a good day
 
Hi,

How are you using .WaitForHost?

Plz post your code.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Shure, there you go
Code:
    Dim System As Object: Set System = CreateObject("EXTRA.System")
    Dim Sessions As Object: Set Sessions = System.Sessions
    Dim Sess0 As Object: Set Sess0 = System.ActiveSession
    Dim Screen As Object: Set Screen = Sess0.Screen

    Dim OldSystemTimeout As Integer: OldSystemTimeout = System.TimeoutValue
    Dim g_HostSettleTime As Integer: g_HostSettleTime = 500
    
    If (g_HostSettleTime > OldSystemTimeout) Then
        OldSystemTimeout = g_HostSettleTime
    End If
    
    With Screen
        .MoveTo 1, 30
        .SendKeys ("PDS     ")
        .MoveTo 2, 46
        .SendKeys ("<EraseEOF>")
        .MoveTo 2, 60
        .SendKeys ("<EraseEOF>")
        .MoveTo 2, 65
        .SendKeys ("<EraseEOF>")
        .SendKeys ("<Enter>")
        .WaitHostQuiet (g_HostSettleTime)
     End With
 
You do realize that your Extra terminal emulator is interfacing you asynchronously to your mainframe computer. When you send off a command, your program has to wait for the mainframe to respond before continuing. It could be less than a second or more than a minute. No one knows.

You would never decide before you left your house to drive to work, that you would stop at every intersection, wait for 5 seconds and then blindly proceed through the intersection. No! You wait for feedback from the asynchronous system of reality to determine when it is safe to proceed.

Likewise, you need to wait for a feedback from the mainframe when it is ready. I used .WaitForCursor at the screen rest coordinates in a loop, something like...
Code:
Scr.MoveTo r+1,c+1
Do Until(Scr.WaitForCursor(r,c))
   DoEvents
Loop

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Hi SkipVought, thanks for replying

I'm aware of that from an 2015 post here in tek tips. But the issue still remains, even with the doevents waiting for the system to answer.

Excel keep's informing OLE issues.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top