capricorn
同學
UID 870
精華
0
積分 0
帖子 8
閱讀權限 99
註冊 2011-10-11 用戶註冊天數 4590
用戶失蹤天數 4537
114.33.145.54
|
|
下面是我每月用來連結集保中心資料的寫法
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.tdcc.com.tw/smWeb/QryStock.jsp?SCA_DATE=" & strDate & "&SqlMethod=StockNo&StockNo=" & stkno & "&StockName=&sub=%ACd%B8%DF", Destination:=Range("A3"))
.Name = "持股分佈"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "6,7,8"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWorkbook.Connections("連線").Delete
PS:我也是半路出師...希望有所幫助
|
|
|