我需要在特定时间每天运行我的excel VBA.我谷歌的ontime方法,但我没有得到全面的了解.我会提出这个来清理我对ontime方法的困惑.
包含excel工作簿是否必须在运行之前打开ontime方法.如果是,是否有办法在特定时间自动打开excel工作簿.我知道它可以由Timer或Windows任务计划程序完成.有人可以帮我解决这个问题.我的当前代码是否为自动化任务调度程序正确构建?
我当前的代码如下所示:
Sub StartTimer()
Application.OnTime EarliestTime:=TimeValue("11:15:00"), Procedure:="rune", _
Schedule:=True
End Sub
Sub rune()
SourceOneUpdate
SourceTwoUpdate
SourceThreeUpdate
GenerateReport
End Sub
Private Sub workbook_open()
StartTimer
End Sub
Run Code Online (Sandbox Code Playgroud)
这是基于这篇文章的想法:http://www.cpearson.com/excel/OnTime.aspx哪个有用.即使这个工作簿是开放的,它也不会自动运行.有人可以帮助我,看看为什么这不正常.
提前致谢.