title: Excel VBA Shell command with spaces in file path
body: <pre><code>Public Sub openEntryFiles()
  Dim filePath, shellCommand, agingsEntry, invenEntry As String
  filePath = Range("CustomerPath").Value2 &amp; "\files\"
  agingsEntry = "agings\entry_EP.bat"
  invenEntry = "inven\entry_EP.bat"
  
  shellCommand = """%ProgramFiles(x86)%\TextPad 5\TextPad.exe"" -r -q -u """ &amp; filePath &amp; agingsEntry &amp; """ -u """ &amp; filePath &amp; invenEntry &amp; """"
  Debug.Print shellCommand
  Shell shellCommand, 0
  End Sub
  </code></pre>
  
  <p>I am trying to write a subroutine that will run a shell command with spaces in the file path. I have done lots of research about using multiple quotes, but I still get a file not found error whenever I run the code. The debug print that is outputted to the Immediate window reads:</p>
  
  <pre><code>"%ProgramFiles(x86)%\TextPad 5\TextPad.exe" -r -q -u "\\ablsgaat002\aclwin\Clients\*****\files\agings\entry_EP.bat" -u "\\ablsgaat002\aclwin\Clients\*****\files\inven\entry_EP.bat"
  </code></pre>
  
  <p>Copying that string into a shell window works great, however, running it from the Shell command in VBA doesn't work. What am I doing wrong?</p>