[算表] 用VBA上網頁抓取成交量

看板Office作者 (隨機)時間6年前 (2018/04/08 16:37), 編輯推噓0(002)
留言2則, 2人參與, 6年前最新討論串1/1
軟體:Excel 版本:2003 我想用VBA上這個網頁http://traderoom.cnyes.com/tse/quote2FB.aspx?code=3550 抓取其中的成交量,抓下來放到Sheet2的A5這個儲存格 但寫完跑一遍出現錯誤,如圖:https://imgur.com/a/9yzdf 程式碼如下: Sub 股價成交量抓取() Application.ScreenUpdating = False Sheet2.Select With ActiveSheet.QueryTables.Add(Connetion:= _ "URL;http://traderoom.cnyes.com/tse/quote2FB.aspx?code=3550", Destination:= _ Range("$A$5")) .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingNone .WebTables = "4" .Refresh BackgroundQuery:=False End With End Sub 請問一下,是哪裡需要修改呢? 謝謝大家的解答! <(_._)> -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.44.244.114 ※ 文章網址: https://www.ptt.cc/bbs/Office/M.1523176621.A.810.html

04/08 17:38, 6年前 , 1F
是connection,原文少了個c
04/08 17:38, 1F

04/08 19:53, 6年前 , 2F
修正了! 謝謝s大~~
04/08 19:53, 2F
文章代碼(AID): #1QoTIjWG (Office)