Consulting

Results 1 to 2 of 2

Thread: Copy data from excel to another application

  1. #1
    Banned VBAX Regular
    Joined
    Mar 2007
    Posts
    36
    Location

    Copy data from excel to another application

    Hi,

    I am looking for a macro that captures the keystrokes. To be more precise I have to create an application which copy data from excel and paste it into another Mainframe application. Similarly once the one cell data is pasted it again goes back to excel copy another cell data and paste it in Mainframe application at a different cell location and so on so forth. The macro should be intelligent enough to check and copy the value of each cell and paste it into application accordingly under correct heading.

    Please help

    Regards,
    Shane

  2. #2
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    Hi Shane,
    This is very doable, but the method really depends on which mainframe emulator you are using. Many actually have referencable libraries that allow you take full control of the emulator from your macro. As far capturing key strokes you can get that data with the WorkSheet_Change event.

    Example:
    [vba]Option Explicit

    Const m_strMySpecialAddress_c As String = "$A$5"
    Private m_rngCheck As Excel.Range

    Private Sub Worksheet_Change(ByVal Target As Range)
    If m_rngCheck Is Nothing Then
    Set m_rngCheck = Me.Range(m_strMySpecialAddress_c)
    End If
    Set Target = Excel.Intersect(m_rngCheck, Target)
    If Not Target Is Nothing Then
    VBA.Beep
    'Send info to mainframe
    End If
    End Sub
    [/vba]

    Post back with your emulator type and version and I might be able to help you whip something up.
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •