Results 1 to 11 of 11

SendKeys

Threaded View

  1. #1
    Registered User
    Join Date
    01-28-2011
    Location
    Sydney Australia
    MS-Off Ver
    Excel 2000
    Posts
    13

    SendKeys

    Hi

    From Excel I want to activate another window and then send some keystrokes to that window.

    From the code below:
    1) the window "destination.txt" ALWAYS comes into focus reliably (becomes active) - this does not seem to be a problem.
    2) the sent keystrokes are VERY intermittent - sometimes they arrive but mostly nothing goes to the "destination.txt" window.

    Private Sub Worksheet_Change(ByVal target As Range)
    If Range("a1") = "1" Then
        AppActivate "destination.txt"
        SendKeys "one", True
    ElseIf Range("a1") = "2" Then
        AppActivate "destination.txt"
        SendKeys "Two", True
    End If
    End Sub
    Any suggestions??
    Last edited by pvj; 02-04-2011 at 08:30 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1