看板 Office 關於我們 聯絡資訊
軟體:EXCEL 版本:2003 如圖:https://imgur.com/a/ALXCw 不知斷點的部份要如何修改? 程式碼如下: Sub 巨集1() With ActiveSheet.QueryTables.Add(Connection:= _ "URL;https://stock.wearn.com/fundthree.asp", Destination:=Range("$A$1")) .Name = "fundthree" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlEntirePage .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With End Sub 謝謝大家的解答! <(_._)> -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.44.244.114 ※ 文章網址: https://www.ptt.cc/bbs/Office/M.1523528631.A.319.html
soyoso: 有什麼錯誤訊息嗎? 04/12 18:59
soyoso: 測試上是可以執行 https://i.imgur.com/cqlkqQH.jpg 04/12 19:00
randomness: 回s大,錯誤訊息如圖https://imgur.com/a/v8oSb 04/12 20:00
randomness: 然後按偵錯,就出現最後一行程式碼為黃色斷點 04/12 20:01
randomness: .Refresh BackgroundQuery:=False 這一行 04/12 20:02
soyoso: 那將網址貼至ie網址列上看是否可開啟 04/12 20:17
randomness: 回s大,我的電腦ie開不了,所以是ie的關係是嗎? 04/12 20:20
randomness: https://imgur.com/a/JJAkQ 04/12 20:26
soyoso: 有可能是這方面的緣故,調整ie方面可瀏覽該網址後再執行巨 04/12 20:27
soyoso: 集試試 04/12 20:28
randomness: 好的,謝謝s大!! 04/12 20:32