title: Excel VBA - Assign Folder Path to Variable
body: <p>I am trying to assign a folder path as a string so that I can reference that path later. Below is some of the code that leads up to that folder path.</p>
  
  <pre><code>Dim fzp as String
  Dim fPath As String
  Dim fso As Object
  Dim subFold
  
  fPath = "I:\PROJECTS\" &amp; ProjNam &amp; "\" &amp; ProjNum
  fso.createfolder (fPath &amp; "copy")
  fso.CopyFolder "S:\Global\Specifications\Proposal Packages\" &amp; ProjNum &amp; "*", fPath &amp; "copy\"
  With fso
  Set subFold = .getfolder(fPath &amp; "copy")
  Set subFold = subFold.Subfolders
  </code></pre>
  
  <p>Now when I look in the local window I see <code>subFold</code> with <code>Item(1)</code> with a Path of "I:\PROJECTS\Foo\bar\Subfoldername"</p>
  
  <p>I want that entire pathway and so I've tried:</p>
  
  <pre><code>fzp = subFold.Path
  fzp = subFold.Item(1).Path
  fzp = .Item(1).Path
  fzp = .Path
  </code></pre>
  
  <p>and probably 20 different iterations without success.</p>
  
  <p>Any idea how I can assign that folder path to a string value or reference it correctly?</p>