×
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

Macro help Attachmate Reflection for UNIX and Open VMS Session

Macro help Attachmate Reflection for UNIX and Open VMS Session

Macro help Attachmate Reflection for UNIX and Open VMS Session

(OP)
Good afternoon,
First off, it's great to finally be here! I look forward to being part of this family. Now for the newbie question...

I need some help creating my 1st macro for Attachmate Reflection for UNIX and Open VMS Session. I'd like for the macro to copy text from cell A1 in Excel, paste it into Reflection, Copy info from cell B1, paste into Reflection and send the ENTER command. Is there also a way to make the macro loop until the last occupied cell is pasted into Reflection? Thanks in advance for all of the help!

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

I would guess that you're looking for SendKeys to type the contents of the various cells into the Reflection window.

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

Hi,

Quote:


...copy text from cell A1 in Excel, paste it into Reflection, Copy info from cell B1, paste into Reflection and send the ENTER command. Is there also a way to make the macro loop until the last occupied cell is pasted into Reflection?

So, where does the value from A1 and B1 go on your terminal emulator screen; screen row and column?

What happens after you load the data from row 1 to the screen? Is there another row on the screen or do you need to SendKeys(some command) before the next row is transferred?

Assuming that the r,c screen coordinates of the A1 value are 9,17, then...

CODE

MyScreen.PutString ActiveSheet.Cells(1, 1).Value, 9, 17 

But we need more info from you to be more specific.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

(OP)
Sorry, been working crazy split shifts recently. Let me get the needed info when I get back into work tomorrow and I'll post it. Thanks for the replies!!!

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

(OP)
Here's what the macro records when I copy and paste the info... Hopefully this helps.

CODE -->

Sub Macro1()
' Generated by the Reflection Macro Recorder on 05-18-2018 11:51:25.54.
' Generated by Reflection for UNIX and OpenVMS 14.0.7.
    On Error GoTo ErrorHandler

    Const NEVER_TIME_OUT = 0

    Dim CR As String    ' Chr(rcCR) = Chr(13) = Control-M
    Dim ESC As String   ' Chr(rcESC) = Chr(27) = Control-[

    CR = Chr(Reflection2.ControlCodes.rcCR)
    ESC = Chr(Reflection2.ControlCodes.rcESC)

    With Session
        ' Press EditPaste (Insert the Clipboard contents at the cursor position).
        ' Reflection has recorded the record-time contents of the clipboard.
        ' If you want to use the playback-time contents of the clipboard,
        ' Uncomment the following line and delete the appropriate record-time data.
        '       .Paste
        .Transmit "9700538287"

        ' The following string was not unique:
        ' .WaitForString ESC & "[4;25H", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: PRESS ANY KEY.."
        .WaitForString "." & ESC & "[4;25H", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press VtEnter (Simulate pressing the Enter key).
        .TransmitTerminalKey rcVtEnterKey

        ' The following string was not unique:
        ' .WaitForString ESC & "[?25h", NEVER_TIME_OUT, rcAllowKeystrokes

        .StatusBar = "Waiting for Prompt: SCAN SLOT TAG:"
        .WaitForString "7H" & ESC & "[?25h", NEVER_TIME_OUT, rcAllowKeystrokes
        .StatusBar = ""
        ' Press EditPaste (Insert the Clipboard contents at the cursor position).
        ' Reflection has recorded the record-time contents of the clipboard.
        ' If you want to use the playback-time contents of the clipboard,
        ' Uncomment the following line and delete the appropriate record-time data.
        '       .Paste
        .Transmit "J6039" & CR

        ' The following string was not unique:
        ' .WaitForString ESC & "[3;22H", NEVER_TIME_OUT, rcAllowKeystrokes

        .WaitForString "." & ESC & "[3;22H", NEVER_TIME_OUT, rcAllowKeystrokes
        ' Press VtEnter (Simulate pressing the Enter key).
        .TransmitTerminalKey rcVtEnterKey

        ' The following string was not unique:
        ' .WaitForString ESC & "[?25h", NEVER_TIME_OUT, rcAllowKeystrokes
        ' .WaitForString "5H" & ESC & "[?25h", NEVER_TIME_OUT, rcAllowKeystrokes
    End With
    Exit Sub

ErrorHandler:
    Session.MsgBox Err.Description, vbExclamation + vbOKOnly

    ' Recording stopped at 11:51:54.46.
End Sub 

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

Thst does not tell us exactly where the values were copied from and where the pasted values went, as I suggested in my post of 10 May 18 17:52.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

(OP)
So, where does the value from A2 and B2 go on your terminal emulator screen; screen row and column?
value from cell A2(244, 15)
value from cell B2 (243, 17)

What happens after you load the data from row 1 to the screen?
A screen pops up saying that the text I entered from cell A2 has been entered, press any key to continue, I press the return key. I enter in the text from cell B2 into (243, 17) and then I'd click on the return key. A screen pops up saying that the text I entered from cell B2 has been entered, press any key to continue, I'd click on the return key.

Is there another row on the screen or do you need to SendKeys(some command) before the next row is transferred?
The screen prompts me to press any key once the data is entered so the return key would be fine.

Link

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

So what I was attempting to ascertain is, once you enter the A2 & B2 values, what happens next?

Either 1) those two values are shipped off somewhere and now you enter the next two vslues from A3 & B3 into 244,15 & 243,17 or 2) A3 & B3 get entered into two different rows until the Excel list is exhausted and then all the values are shipped off or some other?

Am I on the right track?

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

(OP)
SkipVought,

First off, thanks for being so patient with me!

Once the values get entered from B2, (243, 17), the process starts over and the values get entered into the same rows & columns as stated in your 1st scenario that I highlighted in red.

Either 1) those two values are shipped off somewhere and now you enter the next two values from A3 & B3 into 244,15 & 243,17 until the Excel list is exhausted

RE: Macro help Attachmate Reflection for UNIX and Open VMS Session

Good, we’re making progress.

You enter the value from column B, click the Return key, a window pops up with a message and the you “press any key.”

That ends the process for that row of data from your Excel sheet, correct? The “press any key” action is what ships that row of data off to some system way off in Tinbucktoo.

I’ve been working from my iPad. Need my laptop. To be continued....

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

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