dantheman9
Board Regular
- Joined
- Feb 5, 2011
- Messages
- 175
Hi im using the following code to open a local html page as follows;
that is all ok ie opens the right page.
the issue i have is that this page needs to be refreshed, after intervals (i use the vba on time for this bit). but if i move the ie window around- like on to another mointor or even on the same screen, or if i open a new program and leave excel running then it seems to 'forget' or not be able to id the ie window to refresh.
the code im currently using to refresh is as follows;
anyone some ideas on this?
i did try giving the ie window a public object ID, but it seems windows7 doesn't like that method.
Code:
OpenBrowser WebPageDirectory
Function OpenBrowser(tmpURL)
Dim Browser As Object
Set Browser = CreateObject("InternetExplorer.Application")
If Browser.Addressbar = True Then
Browser.Addressbar = False
End If
If Browser.StatusBar = True Then
Browser.StatusBar = False
End If
Browser.Toolbar = False
If Browser.MenuBar = True Then
Browser.MenuBar = False
End If
Browser.Resizable = True
Browser.Visible = True
Browser.Navigate (tmpURL)
End Function
that is all ok ie opens the right page.
the issue i have is that this page needs to be refreshed, after intervals (i use the vba on time for this bit). but if i move the ie window around- like on to another mointor or even on the same screen, or if i open a new program and leave excel running then it seems to 'forget' or not be able to id the ie window to refresh.
the code im currently using to refresh is as follows;
Code:
For rresults = 0 To internetpage.count - 1
my_url = internetpage(rresults).Document.Title
If my_url Like "mypage" Then
internetpage(rresults).refresh
Exit For
End If
Next rresults
anyone some ideas on this?
i did try giving the ie window a public object ID, but it seems windows7 doesn't like that method.