改改 Private Sub CommandButton4_Click() Dim doc As Object Dim txt1 As String Dim i As Integer Dim n&, m$ WebBrowser1.Navigate "http://www.excelpx.com/index.asp" Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE DoEvents Loop Set doc = WebBrowser1.Document k = 1 On Error Resume Next ReDim arr(1 To doc.all.Length, 0) For i = 1 To doc.all.Length txt1 = doc.all.Item(i).FirstChild.innerText If m <> txt1 Then n = n + 1 Cells(n, 1) = txt1 m = txt1 End If Next i WebBrowser1.Navigate "about:blank" End Sub
|