Instrução WaitUntil

Interrompe a execução do programa até ao horário especificado.

Sintaxe:

WaitUntil Time

Parâmetros:

Time: A Date and Time expression that contains the date and time to wait before the program is executed.

Códigos de erro

5 Chamada de procedimento inválido

Exemplo:

REM Aguardar até 18:00 e então chamar MyMacro.
REM Se ocorrer depois de 18:00, finalizar.
Sub ExampleWaitUntil
Dim vTimeschedule As Double
    vTimeSchedule = Date() + TimeValue("18:00:00")
    If vTimeSchedule < Now() Then Exit Sub
    WaitUntil vTimeSchedule
    Call MyMacro
End Sub

Necessitamos da sua ajuda!