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

Macro help Attachmate Reflection for UNIX and Open VMS Session

Status
Not open for further replies.

eosride

IS-IT--Management
May 8, 2018
5
US
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!
 
I would guess that you're looking for SendKeys to type the contents of the various cells into the Reflection window.
 
Hi,

...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,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
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!!!
 
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
 
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,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
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

 
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,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
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
 
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,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top