I'm trying to use vb script to open several different websites on IE and they will refresh all web pages in every 10 seconds. but now i have this codes, it only can refresh the first web, the second web doesn't refresh at all. Could you help with this? Thanks a lot.
Set objExplorer = CreateObject("InternetExplorer.Application")
WebSite ="http://keono.com/"
with objExplorer
.Navigate2 WebSite
.AddressBar = 1
.Visible = 1
.ToolBar = 1
.StatusBar = 1
end with
WebSite = "http://enquotemarketing.com/"
with objExplorer
.Navigate2 WebSite, &h800
.AddressBar = 1
.Visible = 1
.ToolBar = 1
.StatusBar = 1
end with
Do While True
WScript.Sleep 10000 ' 10 seconds
objExplorer.Refresh()
Loop
My understanding is you are trying to open webpages in different IE tabs and then refresh them. New tab opened via
.Navigate2 URL, &h800
is created in a separate brand new IE instance, but since new tab belongs to the IE window, it has the same HWND as IE window. Thus after navigate you can check each explorer window having the same HWND and store new created window to array. Then refresh each IE window within it. Here is the example code: