[算表] 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