I does anyone know how to wait for a shell command to finish running before moving on? My code is throwing a "Run-time error '1004': Sorry, we couldn't find PC_one.csv. Is it possible it was moved, renamed or deleted". The file gets created and give that error. if i run the sub again, it opens the file.
Dim sCommandToRun As String
sCommandToRun = "systeminfo /fo csv > PC_one.csv"
Call Shell("cmd.exe /S /C" & sCommandToRun, vbHide)
Workbooks.Open ("PC_one.csv")