Results 1 to 9 of 9

Using SendKeys, sending keys to different workbooks

Threaded View

  1. #1
    Registered User
    Join Date
    07-17-2020
    Location
    pakistan
    MS-Off Ver
    2019
    Posts
    5

    Using SendKeys, sending keys to different workbooks

    Salam (Blessings) out there!
    I'm using sendkeys function in excel macro to send keys to different workbooks. But only one workbook is getting all the keys. Here is the sample code:

    Sub test()
    AppActivate "book2 - excel"
    SendKeys "abc", True
    AppActivate "book1 - excel"
    SendKeys "def", True
    End Sub
    I'm running this code from book1.
    As per my knowledge, if everything goes right, than book2 must receive the keys abc, and book1 def. But here excel sending all of the keys i.e. "abcdef" to the book1.
    If we remove the line:
    AppActivate "book1 - excel"
    than excel passes the keys to book2.
    What I trying to achieve is that activate a specific workbook or sheet, pass set of keystrokes to it, activate another, pass keystrokes to it and so on.....
    I'm pretty much new at excel macros and vba code. So, unable to figure out the problem.
    Any help is appreciated.....
    Thanks in advance.
    Last edited by AliGW; 07-18-2020 at 04:20 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. IE automation VBA, delay in sending keys, using sendkeys instantly
    By sairakeshraj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2012, 01:43 PM
  2. SendKeys not sending the key when I want it to
    By niko79542 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 03:20 PM
  3. Sending e-mail - Alternative to SendKeys and Wait?
    By Phil_V in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2011, 07:05 PM
  4. Getting Sendkeys to Send Keys
    By starcraftbud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2011, 01:21 PM
  5. Sending Keys from Excel to Internet Explorer
    By matt in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-18-2006, 01:25 PM
  6. [SOLVED] Sending Ctrl-Alt-Del Keys
    By clu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2006, 10:25 AM
  7. Sending keys to DocuCom PDF Driver
    By TroyH in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2005, 07:05 PM

Tags for this Thread

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