我无法理解以下代码有什么问题 -
i = 15
While (i < 100)
If i Mod 2 = 0 Then
handle = FindWindow(vbNullString, "My Details - Windows Internet Explorer")
Range("A1").Value = handle
BringWindowToTop handle
Application.Wait DateAdd("s", 1, Now)
Else
handle1 = FindWindow(vbNullString, "Codeomnitrix - Outlook Web App - Mozilla Firefox")
Range("A2").Value = handle1
BringWindowToTop handle1
Application.Wait DateAdd("s", 1, Now)
End If
i = i + 15
Wend
它应该在两个窗口之间切换并让它们保持焦点直到 1 秒,但实际发生的是它只是将 Firefox 放在顶部,然后没有切换。
谢谢