0

I am making an application using VB6 in which a WebBrowser window is launched using this code, and it refreshes the page every 3 minutes

  Private Sub Form_Load()
 WebBrowser1.Navigate ("http://www.google.com")
 End Sub

  Private Sub T_Timer()

 'Increment minute count
  FireCount = FireCount + 1

  If FireCount = 3 Then
'Reset to 0 for next time
 FireCount = 0
 WebBrowser1.Refresh ("http://www.google.com")
'Refresh web browser
  End If
 End Sub

but it give me an alert saying compile error : wrong number or argument or invalid property assignment. Can any one help me find out my mistake ?

jac
  • 9,666
  • 2
  • 34
  • 63
Nizar Bark
  • 17
  • 7
  • I answered this yesterday [in response to your post](http://stackoverflow.com/questions/15664916/vb6-application-webbrowser-navigate-refresh-every-3-minutes#comment22374008_15665012). – Deanna Apr 02 '13 at 16:06

1 Answers1

2

Assuming WebBrowser1 is a WebBrowser control, you're making a wrong call of Refresh() method. WebBrowser.Refresh() takes no arguments:

'Refresh web browser
WebBrowser1.Refresh

From MSDN:

Wrong number of arguments or invalid property assignment (Error 450)

The number of arguments to a procedure must match the number of parameters in the procedure's definition.

You could also notice that VB6 IDE sets focus to the offending line when compilation fails. Considered together with error description, this info is usually sufficient to pinpoint simple syntax errors.

Ilya Kurnosov
  • 3,180
  • 3
  • 23
  • 37