VB Code:
  1. Private Sub Form_Load()
  2.     WebBrowser1.Navigate "http://www.google.com/"
  3.     WebBrowser1.Silent = True
  4. End Sub
  5.  
  6.  
  7.  
  8. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
  9.     If (pDisp Is WebBrowser1.Application) Then
  10.  
  11.         If URL = "http://www.google.com/" Then 'test for google
  12.  
  13.             Dim HTML As HTMLDocument
  14.             Set HTML = WebBrowser1.Document
  15.             HTML.All.Item("q").Value = "static"
  16.             HTML.All.Item("btnG").Click
  17.         End If
  18.  
  19.     End If
  20. End Sub


I get error

Run-time error '-2 (fffffffe)'

IE7 installed + reference to shdocvw.dll

Really don't know what's going wrong.