VBA sendkeys使用问题
VBA执行Sendkeys"%{TAB}"切换两个excel没反应,寻解决办法执行一下再回答excel与SAP窗口,其实与切换内容关系不大,只要能用sendkey任何窗口...
VBA执行Sendkeys"%{TAB}"切换两个excel没反应,寻解决办法执行一下再回答
excel与SAP窗口,其实与切换内容关系不大,只要能用sendkey任何窗口都可以 展开
excel与SAP窗口,其实与切换内容关系不大,只要能用sendkey任何窗口都可以 展开
3个回答
展开全部
用API吧
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub CommandButton1_Click()
Dim i As Long
keybd_event &H12, 0, 0, 0
For i = 1 To 5
keybd_event &H9, 0, 0, 0
Sleep 1000
keybd_event &H9, 0, &H2, 0
Next
keybd_event &H12, 0, &H2, 0
End Sub
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub CommandButton1_Click()
Dim i As Long
keybd_event &H12, 0, 0, 0
For i = 1 To 5
keybd_event &H9, 0, 0, 0
Sleep 1000
keybd_event &H9, 0, &H2, 0
Next
keybd_event &H12, 0, &H2, 0
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sendkeys"^{TAB}"
追问
你这个是CTRL+TAB
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询