Option ExplicitPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Sub Form_Load() MsgBox "1" Sleep 5000 '5 Segundos DoEvents MsgBox "2"End Sub
Option Explicit Private Declare Function GetTickCount& Lib "kernel32" () Private Sub Command1_Click()Dim retraso As LongMsgBox "1"retraso = 5000 + GetTickCount&While retraso >= GetTickCount& DoEventsWendMsgBox "2"End Sub