Search notes:

Examples for Visual Basic for Application accessing the Windows API: Sleep

The following example needs the VBA declarations of the Windows API which can be found here.
sub main()

    msgBox "I am going to sleep for three soconds"

  '
  ' The Sleep call expects the duration in milliseconds.
  ' 3000 milliseconds is 3 seconds
  '
    Sleep 3000

    msgBox "Woken up"

end sub
Github repository WinAPI-4-VBA, path: /examples/Sleep.bas

See also

The Excel function application.wait allows to schedule the execution of a VBA procedure.
Other examples

Index