Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This is easily the most helpful website I've ever used, and this is the best forum with the quickest response time bar none...."

Geography

Where in the world do Tek-Tips members come from?

send control keys to Reflection from Excel using VBA

fgill (Programmer)
23 May 12 14:50
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
SkipVought (Programmer)
23 May 12 16:08

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

justBanks (Programmer)
30 May 12 14:24
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)

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