title: ShellAndWait not working
body: <p>I'm using ShellAndWait from here <a href="http://www.cpearson.com/excel/ShellAndWait.aspx" rel="nofollow noreferrer">http://www.cpearson.com/excel/ShellAndWait.aspx</a> and I keep getting 1 returned (which means the command didn't work in Windows). But when i paste my cmdLine into Start, Run box it runs fine. Any ideas? I'm using Excel VBA for this and here's my code that I'm calling ShellAndWait with
  What am I doing wrong?</p>
  
  <p>thank you very much</p>
  
  <pre><code>Sub test()
  
  Dim cmdLine As String
  
  cmdLine = "C:\Documents and Settings\natalie.rynda\My Documents\Marta\Calling Files\_SFTP\Minacs.bat"
  
  ShellAndWait cmdLine, 1000, vbHide, PromptUser
  
  If ShellAndWait(cmdLine, 1000, vbHide, PromptUser) = 0 Then
  MsgBox "yes!!!!!!"
  ElseIf ShellAndWait(cmdLine, 1000, vbHide, PromptUser) = 1 Then
  MsgBox "1"
  ElseIf ShellAndWait(cmdLine, 1000, vbHide, PromptUser) = 2 Then
  MsgBox "2"
  ElseIf ShellAndWait(cmdLine, 1000, vbHide, PromptUser) = 3 Then
  MsgBox "3"
  ElseIf ShellAndWait(cmdLine, 1000, vbHide, PromptUser) = 4 Then
  MsgBox "4"
  ElseIf ShellAndWait(cmdLine, 1000, vbHide, PromptUser) = 5 Then
  MsgBox "5"
  ElseIf ShellAndWait(cmdLine, 1000, vbHide, PromptUser) = 6 Then
  MsgBox "6"
  End If
  
  End Sub
  </code></pre>