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

Automate OK Dialog Box Click in OLE

Status
Not open for further replies.

krieg313

Technical User
May 5, 2011
22
US
How can I stop Dialog Boxes / Error Messages from opening in my OLE object "IBMReflection"?
here is the code:

Private Sub cmdQuery_Click()

Dim hostpassword As String
Dim Session As Object
Const SessionCon = "149.83.123.3"

Set Session = CreateObject("ReflectionIBM.Application")
With Session
.Visible = True
.SetupSession rc3270Terminal, rc3270MODEL2E, rcTelNet
.hostname = "149.83.123.3"
.Connect

If .KeyboardLocked = 0 Then

.Connect
.WaitForEvent rcEnterPos, "30", "0", 5, 5
.TransmitANSI "prxy"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "1", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.TransmitTerminalKey rcIBMClearKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.Wait (1)
.TransmitANSI "cesn"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 10, 26
.WaitForDisplayString ".", "30", 10, 24
.TransmitANSI "tbyolmo"
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.Wait (1)
hostpassword = "eq013342"
.TransmitANSI hostpassword
.TransmitTerminalKey rcIBMEnterKey

Else
.StopMacro
Exit Sub
End If

.WaitForEvent rcEnterPos, "30", "0", 24, 76
.WaitForDisplayString "NO.-->", "30", 24, 69
.TransmitANSI "66"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 8, 54
.WaitForDisplayString "2-CANADIAN..>", "30", 8, 39
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey

.WaitForEvent rcEnterPos, "30", "0", 13, 33
.WaitForDisplayString "NUMBER....>", "30", 13, 20
.TransmitANSI RefNumJobDetailsForProxyPlus
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 8, 2
.TransmitTerminalKey rcIBMPf4Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 22
.WaitForDisplayString "JOB................", "30", 3, 2
.TransmitTerminalKey rcIBMPf6Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 10
.WaitForDisplayString "NO.", "5", 3, 6
.TransmitTerminalKey rcIBMPf5Key
.WaitForDisplayString "ENVELOPE ", "5", 2, 38


End With


[Forms]![Log].[SYS SORT] = CInt(Trim(Session.GetDisplayText(17, 53, 15))) '9digit
[Forms]![Log].[5-DIGIT] = CInt(Trim(Session.GetDisplayText(16, 53, 15))) '5digit
[Forms]![Log].[2-5 LO] = CInt(Trim(Session.GetDisplayText(15, 53, 15))) + CInt(Trim(Session.GetDisplayText(14, 53, 15))) '9digit Mul and 5digit Mul Low
'FiveDigitMult = Trim(Session.GetDisplayText(14, 53, 15)) '5digit Mul
'Text11 = Trim(Session.GetDisplayText(13, 53, 15)) 'FRFC
'Text13 = Trim(Session.GetDisplayText(12, 53, 15)) 'FC Multies
[Forms]![Log].[1 ST CLASS ENV] = Trim(Session.GetDisplayText(11, 53, 15)) 'FC Singles
'SYS SORT = Trim(Session.GetDisplayText(10, 53, 15)) 'Foreigns
'Text19 = Trim(Session.GetDisplayText(9, 53, 15)) 'Canada
'Text21 = Trim(Session.GetDisplayText(8, 53, 15)) 'UND
'Text23 = Trim(Session.GetDisplayText(7, 53, 15)) 'SBK
'Text26 = Trim(Session.GetDisplayText(6, 53, 15)) 'LibCop

'Text0 = Trim(Session.GetDisplayText(22, 53, 15)) 'Total

Set Session = Nothing

When the program opens it opens a dialog that I need to click OK to, it doesn't do anything really... but it's annoying that it opens everytime the instance is created.

 
You'll probably need to ask whoever made the "ReflectionIBM.Application" component, or find a forum that specializes in that. It's not a VBA problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top