WaitFor + ShellWait

Tell App to wait for number of seconds
and
Execute command and wait for it (Shell does not wait)


Public

Tested

My Own Work
Sub WaitFor(Seconds2Wait)
Application.wait DateAdd("s", Seconds2Wait, Now)
' Below also works
' Application.Wait (Now + TimeValue("0:00:1"))
End Sub
Sub ShellWait(Fullcmd)
' Run external app and wait for it. Shell DOES NOT wait for external app to finish
' Lines below will wait
Set oShell = CreateObject("WSCript.shell")
oShell.Run FullCmd, 1, True ' "C:\Windows\system32\calc.exe", 1, True
MsgBox "Done?"
End Sub

Seconds2Wait
or
Fullcmd

Views 3851 Downloads 1109

VBA Components
ANmarAmdeen
755
Revisions

v1.0