
VBA Shell in Excel — Run an External Program, and Why Your Code Doesn't Wait
The VBA Shell function launches an external program and immediately walks away — it is fire-and-forget. Shell returns a task ID, not the program's exit code, its output, or a success flag, and the very next line of your macro runs while the program is still starting. That is the bug behind most Shell code, where you Shell a converter and then try to open a file it has not written yet. This guide explains why Shell does not wait, how to quote paths that contain spaces, why Shell launches executables but cannot open a PDF or URL on its own, and when to drop Shell for WScript.Shell Run or Exec so you can actually wait for the program and read what it produced.







































































































