Function RunShell(shellpath As String, sleeptime As Integer) As Integer ' this function executes a shell script and sleeps the prescribed number of seconds ' return 1 for success Dim shellstart As Integer On Error Goto ErrorHandler ' execute shell script/program If (shellpath <>"") Then shellstart = Shell ("shellpath", 6) End If ' sleep Sleep sleeptime RunShell=1 Exit Function ErrorHandler: RunShell=0 Exit Function End Function