如何让vba每10分钟执行一次? [英] How to have vba execute every 10 minutes?
本文介绍了如何让vba每10分钟执行一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这允许它在10分钟内工作
sub my_Procedure )
msgboxhello world
end sub
sub test()
Application.OnTime Now + TimeValue(00:00:10),my_Procedure
end sub
但这只能工作一次。如何让我的宏每10分钟执行一次?
解决方案
你应该使用这种模式:
Sub my_Procedure()
pre>
MsgBoxhello world
再次启动计时器的调用测试
End Sub
Sub test()
Application.OnTime Now + TimeValue(00:10:00),my_Procedure
End Sub
I need to have my macro executed every 10 minutes .
This allows it to work in 10 minutes
sub my_Procedure () msgbox "hello world" end sub sub test() Application.OnTime Now + TimeValue("00:00:10"), "my_Procedure" end sub
But this works only once . How can I have my macro execute every 10 minutes ?
解决方案You should use this pattern:
Sub my_Procedure() MsgBox "hello world" Call test ' for starting timer again End Sub Sub test() Application.OnTime Now + TimeValue("00:10:00"), "my_Procedure" End Sub
这篇关于如何让vba每10分钟执行一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文