[算表] VBA 上网抓取档案

楼主: randomness (随机)   2018-04-12 18:23:48
软件:EXCEL
版本:2003
如图:https://imgur.com/a/ALXCw
不知断点的部份要如何修改?
程式码如下:
Sub 宏1()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://stock.wearn.com/fundthree.asp",
Destination:=Range("$A$1"))
.Name = "fundthree"
.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
.Refresh BackgroundQuery:=False
End With
End Sub
谢谢大家的解答!
<(_._)>
作者: soyoso (我是耀宗)   2018-04-12 18:59:00
有什么错误讯息吗?测试上是可以执行 https://i.imgur.com/cqlkqQH.jpg
楼主: randomness (随机)   2018-04-12 20:00:00
回s大,错误讯息如图https://imgur.com/a/v8oSb然后按侦错,就出现最后一行程式码为黄色断点.Refresh BackgroundQuery:=False 这一行
作者: soyoso (我是耀宗)   2018-04-12 20:17:00
那将网址贴至ie网址列上看是否可开启
楼主: randomness (随机)   2018-04-12 20:20:00
回s大,我的电脑ie开不了,所以是ie的关系是吗?https://imgur.com/a/JJAkQ
作者: soyoso (我是耀宗)   2018-04-12 20:27:00
有可能是这方面的缘故,调整ie方面可浏览该网址后再执行宏试试
楼主: randomness (随机)   2018-04-12 20:32:00
好的,谢谢s大!!

Links booklink

Contact Us: admin [ a t ] ucptt.com