我想登录并导航到另一个大型机页面。
我需要一个接一个地打开三个屏幕。打开第一个屏幕后,应返回主菜单,快捷键为“PageDOWN”。
在 VBA 中使用 SendKeys。
CreateObject("WScript.Shell").Run("")
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
If (System Is Nothing) Then
MsgBox "Could not create the EXTRA System object. Stopping macro playback."
Stop
End If
Set Sessions = System.Sessions
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
Sess0.screen.putstring "pppx" 18, 35
Sess0.screen.SendKeys ("<Enter>")
Sess0.screen.putstring MainLoginID, 14, 17
Sess0.screen.putstring MainLoginPwd, 15, 17
Sess0.screen.SendKeys ("<Enter>")
If activescreen = "FOOD SYSTEMS" Then
Sess0.screen.SendKeys ("<HOME>")
Sess0.screen.putstring "21", 23, 7
Sess0.screen.SendKeys ("<Enter>")
END IF
Sess0.screen.SendKeys "{PGDN}"
试Sess0.screen.SendKeys "{PGDN}"
Sess0.screen.SendKeys ("{PGDN}")
Sess0.screen.SendKeys ("<PGDN>")
除了向下翻页,一切都在工作。Sess0.screen.SendKeys ("<HOME>")
Sess0.screen.SendKeys ("<F7>")
有类似的帖子,但没有找到我的问题的解决方案 Sendkeys Page Down not working .
最佳答案
也许有人还在寻找答案
SendKeys "<PA2>"
这对我有用。
关于vba - MainFrame 应用程序中的 PageDown 键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43061830/