[算表] excel 算表外部連結,巨集出現問題??

作者: a777starmy (呼力贏大師(大輸))   2018-05-29 17:10:38
如題
巨集代碼如下:
===============================
Sub 股票查詢0529()
'
' 股票查詢0529 巨集
'
Dim stocknumber As String
stocknumber = Cells(1, 2).Value
Range("A3:F26").Select
'
With ActiveSheet.QueryTables.Add(Connection = _
"URL;https://stock.wearn.com/cdata.asp?year=107&month=05&kind=" &
stocknumber & " "
.CommandType = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
===================================================
https://imgur.com/a/E8Ejw0U
錯誤代碼如上
我本身是新手,參考以前的,手動更改,但目前不知如何解決上面問題
作者: soyoso (我是耀宗)   2018-05-29 17:27:00
connection:=,少個冒號;" "後面要)括號少了Destination放置所產生查詢的儲存格執行到commanndtype如出現程序呼叫或引數不正確時,可將該行刪除https://i.imgur.com/T1iZD73.jpg
作者: a777starmy (呼力贏大師(大輸))   2018-06-02 00:05:00
樓上大大,謝謝,我再研究看看

Links booklink

Contact Us: admin [ a t ] ucptt.com