當前位置:編程學習大全網 - 網站源碼 - Excel vba 中怎麽通過鏈接獲取網頁源碼

Excel vba 中怎麽通過鏈接獲取網頁源碼

可使用excel自帶的數據導入功能,參考如下程序。如果,從多個帶有壹定規律性的網頁導入,可使用循環語句。Sub宏1()WithActiveSheet.QueryTables.Add(Connection:=_"URL;/lend/detailPage.action?loanId=394578",_Destination:=Range("$A$1")).CommandType=0.Name="detailPage.action?loanId=394578".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.RefreshBackgroundQuery:=FalseEndWithRows("1:25").SelectSelection.DeleteShift:=xlUpRows("12:14").SelectSelection.DeleteShift:=xlUpRows("15:15").SelectActiveWindow.SmallScrollDown:=69Rows("15:90").SelectSelection.DeleteShift:=xlUpActiveWindow.SmallScrollDown:=-33EndSub

  • 上一篇:鬥魚雲遊戲為什麽進不去遊戲
  • 下一篇:兔子增值問題,C語言,新手,求思路
  • copyright 2024編程學習大全網