excel 如何应用发送键Page Down?

rbl8hiat  于 2022-11-26  发布在  其他
关注(0)|答案(2)|浏览(119)

我正在尝试使用VBA发送一个向下翻页键。

Set Myscreen = Sys.Screen, SYS is set as Set Sys = GetObject("C:\Program Files\Attachmate\E!E2K\Sessions\AS400-A.EDP")

我试过了;

Myscreen.SendKeys "{PGDN}"  
Myscreen.SendKeys ("{PGDN}")
Myscreen.SendKeys ("<PGDN>")
Myscreen.SendKeys "{PAGE DOWN}"
Myscreen.SendKeys ("{PAGE DOWN}")
Myscreen.SendKeys ("<PAGE DOWN>")
Myscreen.SendKeys "{PAGE DN}"
Myscreen.SendKeys ("{PAGE DN}")
Myscreen.SendKeys ("<PAGE DN>")
Myscreen.SendKeys "{Down}"
Myscreen.SendKeys ("{Down}")
Myscreen.SendKeys ("<Down>") - this was the only that did anything, it moved the cursor down a line.

我使用Myscreen.Sendkeys ("<DELETE>")删除了工作。

atmip9wb

atmip9wb1#

{Page Down}的正确Syntax应为

Option Explicit
Sub sndkey()
    '// to send multiple times try "{PGDN 5}"
    Application.SendKeys "{PGDN}"
End Sub

请看MSDNSendKeys Class

编辑

好的,我已经测试过了,它能用

Option Explicit
Sub sndkey()
    Dim Myscreen As Object
    Set Myscreen = Sys.Screen
    '// to send multiple times try "{PGDN 5}"
    Myscreen.SendKeys "{PGDN 6}"
End Sub
4urapxun

4urapxun2#

这是正确的语法Myscreen.SendKeys ("<rollup>")

相关问题