title: MkDir not accepting variable argument (EXCEL-VBA)
body: <p>Someone else asked a similar but distinct <a href="https://stackoverflow.com/questions/20661393/excel-vba-mkdir-returns-path-not-found-when-using-variable">question.</a>
  But their methods did not work for me.</p>
  
  <p>I am writing a Sub to iterate over a list, turning the plaintext into hyperlinks based on the cell contents. It just appends the String "CellContents" to the end of a Constant "MyPath".</p>
  
  <p>I wrote an If statement to make the linked directory if it doesn't exist, but I am getting myriad errors when I introduce it. The usual one at the moment is "Error 76: path not found".</p>
  
  <pre><code>            Path = Trim(MyPath &amp; CellContents &amp; "\")
              If Dir(Path, vbDirectory) = "" Then
                  Call MkDir(Path)
              End If
  </code></pre>
  
  <p>I've also tried</p>
  
  <pre><code>             If Dir(Path, vbDirectory) = "" Then
                  MkDir Path
               End If
  </code></pre>
  
  <p>I know for certain that the containing folder exists, and I've tried using Call MkDir and MkDir alone. I've also tried Trim()/no Trim() on Path, which does not solve it (and the inputs are strings so Str() causes its own error). I've also tried Len(Dir(Path)=0 in the conditional, none of which helps MkDir recognize that Path is a valid path! Why is it not being recognized correctly?</p>