回覆列表
  • 1 # 使用者6675783066594

    新建個窗體,新增CommandButton、WebBrowser控制元件。CommandButton控制元件用程式碼:Sub Test()Dim i As Long

    Dim URL As String

    Dim MySheet As Object

    Dim MyBrowser As Object

    Set MyBrowser = UserForm1.WebBrowser1

    Set MySheet= Thisworkbook.Sheets(“測試”)

    MySheet.Cells.NumberFormat = "@"

    With MyBrowser For i=2 To MySheet.UsedRange.Rows.CountURL = MySheet.Cells(i, 1).Value

    .Navigate URL

    Do Until .ReadyState = 4

    DoEvents

    Loop

    MySheet.Cells(i, 2) = .Document.body.innerhtml Next i

    End With

    Set MyBrowser = Nothing End Sub

  • 中秋節和大豐收的關聯?
  • 沙漠玫瑰的養殖方法?