您好我在Excel中有2个命令按钮,MarketOpen和MarketClosed。
单击MarketOpen时会发生以下循环:
Private Sub CommandButton1_Click()
MarketOpen
End Sub
Private Sub CommandButton2_Click()
Marketclosed
End Sub
Sub MarketOpen()
Application.OnTime Now + TimeValue("00:00:05"), "RefreshStocks"
End Sub
Sub RefreshStocks()
Application.CalculateFull
MarketOpen
End Sub
我试图用
结束循环Sub MarketClosed()
Application.OnTime Now + TimeValue("00:00:05"), "RefreshStocks", , False
End Sub
但是,我遇到了运行时错误' 1004':
方法' Ontime'对象' _Application'失败。
谢谢!