Private Sub Command1_Click()
check (WebBrowser1)
End SubSub check(wb) '<< 這裡用wb 為什麼錯誤, 應該寫什麼來定義 webbrowser??For i = 0 To wb.Document.All.length - 1
If UCase(wb.Document.All(i).tagName) = "A" Then
  Set ggrepa = CreateObject("VBScript.RegExp")
  ggrepa.Pattern = Text3.Text
  ggrepa.Global = True
  Set ggmat = ggrepa.Execute(wb.Document.All(i).href)
    For Each ggresult In ggmat
      wb.Document.All(i).Click
    Next
End If
Next iEnd Sub