Hello,
I'm trying to find a command that would temporarily pause my script and allow data from a database to be fully imported before continuing the script. It takes a few seconds for it all to be imported. My code doesn't account for this and it continues to run other subs that are based off this data so this ultimately causes my script to crash.
I've tried using these two commands but all they did was temporarily stop anything from running (including the data that is being imported) which causes the same issues as before. At the bottom is a gist of what I want my code to do
Here is a general idea of what I want my code to do
Thanks!!
I'm trying to find a command that would temporarily pause my script and allow data from a database to be fully imported before continuing the script. It takes a few seconds for it all to be imported. My code doesn't account for this and it continues to run other subs that are based off this data so this ultimately causes my script to crash.
I've tried using these two commands but all they did was temporarily stop anything from running (including the data that is being imported) which causes the same issues as before. At the bottom is a gist of what I want my code to do
Code:
Sub()
Application.Wait (Now + TimeValue("0:00:5"))
End Sub
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub()
Sleep 500
End sub
Here is a general idea of what I want my code to do
Code:
Sub()
-apply user defined settings
Application.Calculate [COLOR=#0000ff]'data starts to be imported from database[/COLOR]
-pause for a few seconds [COLOR=#0000ff]'allows data to be fully imported[/COLOR]
-call other subs
End sub
Thanks!!