------------------------------------------------------------------------
Sub Webloading()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
IE.Navigate "http://tw.stock.yahoo.com/"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set objCollection = IE.document.getElementsByTagName("input")
i = 0
While i < objCollection.Length
If objCollection(i).Name = "stock_id" Then
objCollection(i).Value = "2330"
Else
If objCollection(i).Type = "submit" And _
objCollection(i).Name = "xSubmit" Then
Set objElement = objCollection(i)
End If
End If
i = i + 1
Wend
objElement.Click
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
IE.Visible = True
Set objElement = Nothing
Set objCollection = Nothing
End Sub
-------------------------------------------------------------------------