Customer Center

Welcome back

My Account Logout
#4826

The problem is that keys like that are "hits" whereas when a user does those sequences, the are really press, press, release, release. The reason that may work "intermittantly is due to app response time.  

Here's how to more closely mimic how a user presses and releases keys:
Sub SelectWithKeys()
    Dim k As New BWS10.Keys
    ' Be sure you are in the field first with a Pause etc -these keys just send they make no attempt to activate a window etc!!
        k.Press "{SHIFT}", SendInput_
        DoEvents_ ' these are important to mimic user speed – may even need more than one…
        k.Press "{CTRL}", SendInput_
        DoEvents_
        k.Press "{CTRL}", SendInput_
        DoEvents_
        k.Press "{END}", SendInput_
        DoEvents_
        k.Release "{END}", SendInput_
        DoEvents_
        k.Release "{CTRL}", SendInput_
        DoEvents_
        k.Release "{SHIFT}", SendInput_
        k.Key "{BS}", SendInput_
End Sub