snare wrote:
今天再次測試msxml2...(恕刪)
謝謝樓主如此神速放上修正程式碼,以舊版方式運用在多筆連續查詢yahoo股市,若設定重查html的次數為3,還是會發生中斷,經設定為5次,測試過程暫未發生中斷的情形
g80860 wrote:
我有個dde,其中成交價.
我想每分鐘可以自動記紀錄--->在指定工作表上,每分記錄完成--->往下一格.
Dim lastrow As Double
Sub start()
Cells.Clear
lastrow = 0
Application.OnTime TimeValue("21:15:00"), "record" '開始時間
End Sub
Sub record()
lastrow = lastrow + 1 '每次往下一列
'==========
'程式碼放這邊
Cells(lastrow, 1) = Format(Now, "hh:mm:ss") ' test
Cells(lastrow, 2) = Rnd(Timer) 'test
'==========
If Format(Now, "hh:mm") = "21:20" Then '結束時間
Cells(lastrow + 1, 1) = "end" 'debug
Exit Sub
End If
Application.OnTime Now + TimeValue("00:00:03"), "record" '間隔秒數
End Sub