相关疑难解决方法(0)

发送密钥正在禁用NumLock

问题:

当我使用SendKeys将数据从Excel应用程序复制到另一个(非Microsoft)应用程序时,我的Num Lock将被禁用.

Sub Test()

    Range("A1:B71").Select
    SendKeys "^C" 'Copies Selected Text

    AppActivate "AccuTerm 2K2"
    SendKeys "2", True    'Enters to notes screen
    SendKeys "^M", True   'Confirms above (Enter key)
    SendKeys "^V", True   'Pastes into client application

    Application.Wait (Now + TimeValue("0:00:05"))
    'Providing time for client application to finish
    'pasting...

    SendKeys "^M", True   'Next three enters are to
    SendKeys "^M", True   '...exit notes section
    SendKeys "^M", True
    AppActivate "Microsoft Excel"

    Range("B52:B62").Clear  'Clears the Template
    Range("B52").Select     'Resets Cell Position

End Sub
Run Code Online (Sandbox Code Playgroud)

首选决议: …

excel vba excel-vba sendkeys num-lock

0
推荐指数
1
解决办法
3712
查看次数

标签 统计

excel ×1

excel-vba ×1

num-lock ×1

sendkeys ×1

vba ×1