Link to home
Start Free TrialLog in
Avatar of const71
const71

asked on

Shellexecute Opens HTML first time but fails to reload when called again

I am trying to refresh a webpage from within a VB program. The first call opens the page successfully, however when Shellexecute is called again, the page is not refreshed (it contains the same page from the first call)

How do I force a reload (like when i click the refresh toolbar button in the explorer browser)


Thanks
ASKER CERTIFIED SOLUTION
Avatar of paulgrunner
paulgrunner

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of junglerover77
junglerover77

Just put 3 buttons on a form and try the following code:

Dim objIE As Object

Private Sub Command1_Click()
    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Visible = True
    objIE.Navigate2 ("https://www.experts-exchange.com")
End Sub

Private Sub Command2_Click()
    objIE.Refresh
End Sub

Private Sub Command3_Click()
    objIE.Quit
End Sub

"SHDocVw.InternetExplorer" is an Interface, not Class, so that paulgrunner's code would work well in a computer with VB6 installed, but might not work properly in a computer without VB6. But Internet.Application is a Class.