WaitFor + ShellWait

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

CodeFunctionName
What is this?

Public

Tested

Original 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 4,462

Downloads 1,379

CodeID
DB ID

ANmarAmdeen
610
Revisions

v1.0

Saturday
June
16
2018