这个就行
Sub APPLICATION_Timer(ID)
dim h_time
dim m_time
dim s_time
h_time = Hour(Now)
m_time = Minute(Now)
s_time = Second(Now)
If h_time = 14 and m_time = 57 and s_time = 00 then
CreateObject("SAPI.SpVoice").Speak "马上收盘了!!!快准备平仓!!! "
End if
End Sub
这个就行
Sub APPLICATION_Timer(ID)
dim h_time
dim m_time
dim s_time
h_time = Hour(Now)
m_time = Minute(Now)
s_time = Second(Now)
If h_time = 14 and m_time = 57 and s_time = 00 then
CreateObject("SAPI.SpVoice").Speak "马上收盘了!!!快准备平仓!!! "
End if
End Sub
呵呵,这种方式想到过,问题是间隔多长时间触发一次,时间过短的话,实在太影响效率了。不过实在不行,也只能这样了。最好提供一个类似vba里ontime这样的机制。
设置定时器,定时的时间:收盘时间-现在时间
Sub APPLICATION_Timer(ID)
………'要执行的代码
application.killtimer (把定时器取消)
End Sub