×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

send control keys to Reflection from Excel using VBA

send control keys to Reflection from Excel using VBA

send control keys to Reflection from Excel using VBA

(OP)
Hello,
I am trying to send control keys to Reflection from Excel using VBA. I have successfully started a reflection session and have sent text to the screen.
What I have been unable to figure out is how to “press enter button”, or pass any control key.
Any assistance is greatly appreciated.

Using: Win7; Excel 2010; Attachmate Reflection Standard Suite 2011_15.3.436.0, Version R1 (15.3436.0)

The following is the VBA code from Excel:

Sub CreateReflectionObject()
'the following are the references which are selected
'Library Attachmate_Reflection_Objects
' C:\Program Files (x86)\Attachmate\Reflection\Attachmate.Reflection.Objects.tlb

'Library Attachmate_Reflection_Objects_Emulation_IbmHosts
' C:\Program Files (x86)\Attachmate\Reflection\Attachmate.Reflection.Objects.Emulation.IbmHosts.tlb

Const rcIBMEnterKey As Integer = 13

Set Ribm = CreateObject("ReflectionIBM.Session")
Ribm.Visible = True

With Ribm
.Hostname = "PRDPLEX-TN3270A.FGMFCON.COM"
.Connect
End With

With Ribm
.TransmitANSI "l cicsa1b2"

'none of the following examples work
.TransmitTerminalKey ([ENTER])
.TransmitTerminalKey rcIBMEnterKey
.TransmitTerminalKey (ControlKeyCode_Transmit)
.SendControlKey (rcIBMEnterKey)
.Transmit (ControlKeyCode_Transmit)

End With

End Sub

RE: send control keys to Reflection from Excel using VBA


I don't use Reflection but I do use Extra.

You have assigned an APPLICATION object.

It seems that you should perhaps also assign a SESSION and SCREEN object or at least a SCREEN object to use any transmit or send method.

What does your Reflection HELP indicate as far as initializing your objects?

How does your help indicate that the transmit and send methods are to be referenced?

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: send control keys to Reflection from Excel using VBA

I use the ControlKeyCode_Transmit constant with the SendControlKey function, as in the following line:

screen.SendControlKey(ControlKeyCode_Transmit)


In this example, the screen variable is set to the Screen property of the Terminal object:

Dim App As Attachmate_Reflection_Objects_Framework.ApplicationObject
Dim screen As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmScreen
Dim Terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
Dim Frame As Attachmate_Reflection_Objects.Frame
Dim View As Attachmate_Reflection_Objects.View

Set App = CreateObject("Attachmate_Reflection_Objects_Framework.ApplicationObject")

' Open a settings file from a trusted location
Set Terminal = App.CreateControl(sessionFilePath)
Set screen = Terminal.Screen
Set Frame = App.GetObject("Frame")
Frame.Visible = True
Set View = Frame.CreateView(Terminal)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close