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

SendKey Syntax

Status
Not open for further replies.

Wgimblet

Technical User
Sep 6, 2010
5
US
Can you use SendKey to send a string variable to an app?

Code:
Sub test2123()
 Dim MtrId As String

    MtrId = ActiveCell.Text
    AppActivate "Test.txt - Notepad"
    SendKeys MtrId, True

End Sub
 
Code:
Sub test2123()
 Dim MtrId As String
    MtrId = ActiveCell.Text
    AppActivate "Test.txt - Notepad"[blue], True[/blue]
    SendKeys MtrId, True
End Sub

combo
 
Thanks for the help. As it turns out it seems my problem is that I was using the shift key as part of the combo of buttons to hotkey the macro. The shift key is causing the sendkeys function to fail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top