Timing Delays in VBA

后端 未结 12 2244
陌清茗
陌清茗 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:20

    Your code only creates a time without a date. If your assumption is correct that when it runs the application.wait the time actually already reached that time it will wait for 24 hours exactly. I also worry a bit about calling now() multiple times (could be different?) I would change the code to

     application.wait DateAdd("s", 1, Now)
    

提交回复
热议问题