Sub 年線()
Dim A As Object, E As Object
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://www.twse.com.tw/ch/trading/exchange/FMNPTK/FMNPTKMAIN.php"
Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
For Each A In .document.getelementSbyTAGNAME("INPUT")
If A.Name = "CO_ID" Then A.Value = ActiveSheet.Range("A1")
If A.Value = "查詢" Then A.Click
Next
Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
Cells.Clear
.ExecWB 17, 2
.ExecWB 12, 2
With ActiveSheet
.UsedRange.Offset(1).Clear
.Cells(2, 1).Select
.PasteSpecial Format:="HTML"
End With
.Quit
End With
End Sub