VBA to Activate Internet Explorer Window

前端 未结 1 1925
臣服心动
臣服心动 2021-01-27 12:01

I\'m making a macro that opens Internet Explorer, navigates and logs into a website. Everything works fine, but I need to bring the IE Window up front, and activate it, so I can

相关标签:
1条回答
  • 2021-01-27 12:12

    I always just make IE an untyped object, like so

    Sub test()
    Dim IE As Object
    
    Set IE = Nothing
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "www.google.com"
    IE.Visible = True
    
    End Sub
    

    The IE window has focus when this finishes running on my end.

    0 讨论(0)
提交回复
热议问题