_Application.OnTime(Object, String, Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Schedules a procedure to be run at a specified time in the future (either at a specific time of day or after a specific amount of time has passed).
public void OnTime (object EarliestTime, string Procedure, object LatestTime, object Schedule);
Public Sub OnTime (EarliestTime As Object, Procedure As String, Optional LatestTime As Object, Optional Schedule As Object)
Parameters
- EarliestTime
- Object
Required Object. The time when you want this procedure to be run.
- Procedure
- String
Required String. The name of the procedure to be run.
- LatestTime
- Object
Optional Object. The latest time at which the procedure can be run. For example, if LatestTime
is set to EarliestTime
+ 30 and Microsoft Excel is not in Ready, Copy, Cut, or Find mode at EarliestTime
because another procedure is running, Microsoft Excel will wait 30 seconds for the first procedure to complete. If Microsoft Excel is not in Ready mode within 30 seconds, the procedure won’t be run. If this argument is omitted, Microsoft Excel will wait until the procedure can be run.
- Schedule
- Object
Optional Object. True to schedule a new OnTime procedure. False to clear a previously set procedure. The default value is True.
Remarks
Use Now+TimeValue(time) to schedule something to be run when a specific amount of time (counting from now) has elapsed. Use TimeValue(time) to schedule something to be run a specific time.
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기