【发布时间】:2015-03-30 13:40:16
【问题描述】:
我想用一个 excel vba 代码在这个链接上显示财务信息,但是我目前的代码无法做到这一点。
我想复制并粘贴所有的数据。它是否包含其他信息并不重要。
我该怎么做?
链接:http://financials.morningstar.com/cash-flow/cf.html?t=SPN®ion=usa&culture=en-US 子 MS()
Sheets("Morningstar").ClearContents my_Page = "http://financials.morningstar.com/cash-flow/cf.html?t=SPN®ion=usa&culture=en-US"
Sub MS()
Sheets("Morningstar").ClearContents
my_Page = "http://financials.morningstar.com/cash-flow/cf.html t=SPN®ion=usa&culture=en-US"
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate my_Page
Do Until .ReadyState = 4: DoEvents: Loop
End With
Application.EnableEvents = False
IE.ExecWB 17, 0
Do Until IE.ReadyState = 4: DoEvents: Loop
IE.ExecWB 12, 2
ActiveSheet.PasteSpecial Format:="HTML", link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
Range("A1").Select
IE.Quit
Application.EnableEvents = True
End Sub
【问题讨论】:
-
您可以在问题中添加您当前的代码吗?
-
我已经添加了代码。谢谢。