看板 Visual_Basic 關於我們 聯絡資訊
目前我有寫一段VBA以POST方式去擷取網頁資料 但當擷取網頁資料,沒有資料時候會跳出警告視窗,程式就中斷了 不知道要用怎樣方式克服呢? thx With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://abc.asp",Destination:=Range("A1")) .PostText = Qyt_ptxt 'POST的參數 .Name = "測試擷取" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = False .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlOverwriteCells .SavePassword = False .SaveData = False .AdjustColumnWidth = False .RefreshPeriod = 0 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingNone .WebTables = "2" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 182.235.68.160
bulldog:On Error Next 12/26 01:18