Sub text()
Dim myIE As InternetExplorer
Dim myItem
Dim QryTbl As QueryTable
Dim myItems
Dim WebAddress As String
Dim mydate As Date
Set myIE = New InternetExplorer
With myIE
.Visible = True
.Navigate "http://www.taifex.com.tw/chinese/3/3_1_1.asp"
Do Until .ReadyState = READYSTATE_COMPLETE
Loop
End With
With myIE.Document.myform
.COMMODITY_IDt.Value = "TF" '設定契約
End With
Set myItems = myIE.Document.getElementsByTagName("Input")
For Each myItem In myItems
If myItem.Value = "送出查詢" Then
myItem.Click '按下送出查詢按鈕
End If
Next
With Worksheets("臨時資料2")
.Cells.Clear
Set QryTbl = .QueryTables.Add("URL;" & WebAddress, .Range("A1"))
End With
QryTbl.Refresh True
End Sub
----------------------------
錯誤一直卡在這列
QryTbl.Refresh True
想請教有什麼方式能解決此問題 ..
感謝回覆:)作者: GBKEE 時間: 2015-6-2 17:10