返回列表 上一主題 發帖

[發問] EXCEL VBA 匯入PCHOME網頁資料

[發問] EXCEL VBA 匯入PCHOME網頁資料

各位前輩 你們好

我想使用外部網頁資料匯入 "http://pchome.megatime.com.tw/stock/sid9907.html" 匯到EXCEL 中 但是VBA沒有反應

有前輩可以幫忙解決這個問題嗎

ScreenShot00102.png (36.26 KB)

ScreenShot00102.png

活頁簿1.rar (16.71 KB)

回復 2# GBKEE

GBKEE前輩您好 小弟初學 VBA 針對以下程式碼想加以了解
      xadte = DateAdd("yyyy", -1, Date)  '日期(起):
      '執行此行的目的是??
    With CreateObject("InternetExplorer.Application")                                          
      '此行是否開啟InternetExplorer APP ??
        .Visible = True                                                                                                                          
        .Navigate "http://pchome.megatime.com.tw/stock/sid9907.html"           
      '此行是將InternetExplorer輸入網址嗎??
        Do While .Busy Or .ReadyState <> 4: DoEvents: Loop                                 
        '此行當中的 .Busy Or .ReadyState <> 4: DoEvents: Loop甚麼意思??
        Set E = .document.getElementsByTAGName("TABLE")(4)                           
   '此行是定義甚麼意思
    End With

TOP

        靜思自在 : 有時當思無時苦,好天要積雨來糧。
返回列表 上一主題