|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 richdaddy 于 2012-6-6 16:11 编辑
各位老师,探讨个问题,我想解决这个问题的方法好久了,找到了思路。先用 CreateObject("InternetExplorer.application") ,再用QueryTables 提取数据,
不过在提取数据的时候老出问题,各位大侠能否拔刀相助。谢谢!
一下是我的代码,请斧正。
Sub weblog()
Dim myQuery
With ActiveSheet
.Cells.Delete
.[a1] = "Conneting, Please Wait..."
Call GotoHome("tocklist2012@yahoo.com.cn", "123456***")
Set myQuery = ActiveSheet.QueryTables _
.Add(Connection:="URL;http://vip.stock.finance.sina.com.cn/portfolio/main.php ", _
Destination:=.Cells(1, 1))
With myQuery
.Name = "list"
End With
End With
With myQuery
.Refresh
End With
End Sub
Sub GotoHome(sUser As String, sPwd As String)
'先引用Microsoft Internet Controls
Dim IEList 'As New ShellWindows
Dim IE, TimeIE
Dim bt As String
On Error Resume Next
Set IE = CreateObject("InternetExplorer.application")
IE.Navigate URL:=" http://vip.stock.finance.sina.com.cn/portfolio/main.php"
IE.Quit
Set IE = Nothing
Set IEList = Nothing
End Sub
|
评分
-
1
查看全部评分
-
|