title: Vba - returning Shell explorer current path and then close it
body: <p>First of all, I must say that I'm running a code in a machine that has very few references installed and no Office at all.</p>
  
  <p>I need to open an "explorer.exe" instance with the <code>Shell</code> command, browse through folders, enter in a selected (or newly created) one and finally click on "Ok" on a <code>MsgBox</code> (which pops up simultaneously) to close the <code>Shell</code> and return the selected folder path to a variable.</p>
  
  <p>I have no idea how to achieve that. When I use <code>CurDir</code>, I end up getting a folder which is not the selected one.</p>
  
  <p>Code used (which didn't work):</p>
  
  <pre><code>Sub BrowseForFolder()
  
  ActualDir = "D:\"
  Call Shell("C:\Windows\explorer", ActualDir, 1)
  
  If Msgbox("Browse into folder or create a new one and then browse into it, then click ok", vbOkOnly, "Browse") = vbOk Then
      ' here should be the command to return the path. The following doesn't work since it returns always "D:\"
      ActualDir = CurDir
  End If
  
  ' Here I have to close the Shell - I have no idea what to write to do it
  
  End Sub
  </code></pre>