Timing Delays in VBA

后端 未结 12 2243
陌清茗
陌清茗 2020-11-28 13:48

I would like a 1 second delay in my code. Below is the code I am trying to make this delay. I think it polls the date and time off the operating system and waits until the

12条回答
  •  借酒劲吻你
    2020-11-28 14:02

    Have you tried to use Sleep?

    There's an example HERE (copied below):

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
    Private Sub Form_Activate()    
    
    frmSplash.Show
    DoEvents
    Sleep 1000
    Unload Me
    frmProfiles.Show
    
    End Sub
    

    Notice it might freeze the application for the chosen amount of time.

提交回复
热议问题