返回列表 上一主題 發帖

[發問] 網頁下載後沒有東西

[發問] 網頁下載後沒有東西

各位好
程式碼如下,下載資料後,是空空的,不知該改哪
所以想請各位幫幫忙
謝謝!! 感恩
  1. Sub abc()
  2.     Dim Theurl As String, Sdate
  3.     Dim URL As String, xDate As String, A As Date
  4.     A = Range("A2").Value
  5.     xDate = Format(A, "E/MM/DD")
  6.     Theurl = "http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade_download.php?t=D&d=" & xDate & "&s=0"


  7.     With ActiveSheet.QueryTables.Add(Connection:="URL;" & Theurl, Destination:=Range("B3"))
  8.         .BackgroundQuery = True
  9.         .RefreshStyle = xlOverwriteCells
  10.         .RefreshPeriod = 0
  11.         .AdjustColumnWidth = False
  12.         .WebSelectionType = xlSpecifiedTables
  13.         .WebFormatting = xlWebFormattingNone
  14.         '.WebTables = "1,2,3,4"
  15.         .WebDisableDateRecognition = True         '關閉日期辨識
  16.         .Refresh BackgroundQuery:=False
  17.         .ResultRange.Columns(1).TextToColumns Destination:=.ResultRange.Cells(1), DataType:=xlDelimited, _
  18.                 TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
  19.                 Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
  20.                 :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
  21.                 Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _
  22.                 ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array _
  23.                 (20, 1)), TrailingMinusNumbers:=True
  24.             'TextToColumns 方法 (資料剖析)的參數可錄製得到
  25.             'ResultRange.Columns(1):weby資料的第一欄
  26.             'ResultRange.Cells(1)  :weby資料的第一個Cells(儲存格)
  27.             '.Delete
  28.             
  29.      


  30.     End With
  31. End Sub
複製代碼

回復 3# GBKEE


    請問G大
您的方式要如何修改
可否再補充說明
謝謝!!

TOP

回復 2# joey0415


    謝謝您的回覆

TOP

回復 6# GBKEE


   G 大
了解   感恩!!

TOP

        靜思自在 : 天上最美是星星,人生最美是溫情。
返回列表 上一主題