Contact US

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!

*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

CopyAppend in Attachmate

CopyAppend in Attachmate

CopyAppend in Attachmate

I'm using Attachmate Extra! X-treme 9.1

I have a situation where I need to copy two pieces of information from a database to paste into another program, but where I have to make a decision as to which set of data (if at all) that I need.

What I am trying to do is have a single macro that will copy the first bit of data and then append the 2nd bit.

The copy portion is working just fine.


But it is failing to append the second data piece


PS - There are only two pieces of data I have to choose between, so to keep it super simple my plan is to just have two separate macros - one to copy data set A and the other to copy B.

Any help would be appreciated.

RE: CopyAppend in Attachmate


not sure what your code is but give this a whirl for a test


Sub Main()

    Dim Sys As Object, Sess As Object, MyScreen As Object
    Dim MyArea As Object
    Set Sys = CreateObject("EXTRA.System")
    Set Sess = Sys.ActiveSession

    Set MyScreen = Sess.Screen
    MyScreen.putstring "HELLO", 1, 1
    MyScreen.putstring "THIS", 2, 1
    MyScreen.putstring "IS", 3, 1
    MyScreen.putstring "A", 4, 1
    MyScreen.putstring "TEST", 5, 1
    Set MyArea = MyScreen.Area(1,1,2,5,,)
    MyScreen.Moveto 10, 2
    Set MyArea = MyScreen.Area(3,1,5,5,,)
    MyScreen.Moveto 20, 10
End Sub 

RE: CopyAppend in Attachmate

My code is very simple and that may be the problem.

Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 is Nothing) Then
Msgbox "Could not create the Session object. Stopping macro playback."
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE

' This section of code contains the recorded events
Sess0.QuickPads("TOP BAR").Visible = True
Sess0.Screen.Select 14,66,14,75
Sess0.Screen.Select 6,13,6,73

The macro copies the first bit of info to the clipboard perfectly (14,66,14,75) but fails to append the second segment (6,13,6,73) to the clipboard.

RE: CopyAppend in Attachmate

Did you try the code I posted?

RE: CopyAppend in Attachmate

the recorded macro does not work;

this will work


Sub Main()

    Dim Sessions As Object
    Dim System As Object
    Set System = CreateObject("EXTRA.System")
    Dim Sess0 As Object
    Set Sess0 = System.ActiveSession
    Dim MyArea As Object

    Set MyArea = sess0.screen.Area(14,66,14,75,,)

    Set MyArea = sess0.screen.Area(6,13,6,73,,)
    sess0.screen.Moveto 20, 10
End Sub 

I'm not sure what you are doing after CopyAppend; I pasted the data into row 20, col 10

RE: CopyAppend in Attachmate

Thanks, Remy!!!

I tried to adapt the code in your original post to what I was trying to do (and failed miserably in the process).

This is exactly what I was needing!

RE: CopyAppend in Attachmate

so this is good now?

RE: CopyAppend in Attachmate

Don't forget, "Great post? Star it!"


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

RE: CopyAppend in Attachmate

It is starred now! Again thanks, Remy - it was exactly what I needed and it works perfectly.

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! Already a Member? Login

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