ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ºô¯¸³z¹LQueryTable¤U¸üªº¤é´Á°ÝÃD

¦^´_ 1# PKKO

¸Õ¸Õ¬Ý³o­Ó¡G
    Sub test1()
Dim QT As QueryTable
Dim WebAddress As String
    ' WebAddress = "http://www.cnyes.com/twstock/ps_historyprice/2327.htm"

WebAddress = "https://www.cnyes.com/twstock/ps_historyprice.aspx?"
WebAddress = WebAddress & "code=2327"
WebAddress = WebAddress & "&ctl00$ContentPlaceHolder1$startText=2019/01/01"
WebAddress = WebAddress & "&ctl00$ContentPlaceHolder1$endText=2020/03/06"

With ThisWorkbook.Worksheets("DL")
    .Cells.Clear
    Set QT = .QueryTables.Add("URL;" & WebAddress, .Range("$A$1"))
End With
With QT
   ' .PostText = "ctl00$ContentPlaceHolder1$startText=" & " 2019/01/01" & "&ctl00$ContentPlaceHolder1$endText=" & " 2020/03/06"
.WebTables = "1"
.Refresh False
.Delete
End With
End Sub

TOP

¥»©«³Ì«á¥Ñ Scott090 ©ó 2020-3-8 14:34 ½s¿è

¦^´_ 3# PKKO

¦A´ú¸Õ¦p¤U¡G
       Sub test1()
Dim QT As QueryTable
Dim WebAddress As String
  '  WebAddress = "http://www.cnyes.com/twstock/ps_historyprice/2327.htm"

WebAddress = "https://www.cnyes.com/twstock/ps_historyprice.aspx?code=2327"
With ThisWorkbook.Worksheets("DL")
    .Cells.Clear
    Set QT = .QueryTables.Add("URL;" & WebAddress, .Range("$A$1"))
End With
With QT
     '.PostText = "ctl00$ContentPlaceHolder1$startText=" & " 2019/01/01" & "&ctl00$ContentPlaceHolder1$endText=" & " 2020/03/06"
'¤é´Á»Pµ¥¸¹¶¡¤£­n¦³ªÅ®æ
'======================
   .PostText = "ctl00$ContentPlaceHolder1$startText=" & "2019/01/01" & "&ctl00$ContentPlaceHolder1$endText=" & "2020/03/06"
.WebTables = "1"
.Refresh False
.Delete
End With
End Sub

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD