title: Creating a new folder in Sharepoint using VBA
body: <p>I'm trying to automatically save workbooks using VBA to a Sharepoint folder- which needs to be created first.
  Code I have below works ONLY for saving the file. The MkDir function returns a Run-time error 76: Path not found. I'm at a loss what causes this error, because the path before /txt DOES exist and I do have the right permissions to add new folders by hand. I have also tried replacing the current path with \ instead of /, but other than making the code significantly slower this has no effect. No "solutions" online have done the trick for me.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>MkDir "https://placeholder.sharepoint.com/teams/Services_NL/Shared Documents/txt"
  DateAndTime = Left(Replace(Replace(Replace(Now, " ", "_"), ":", ""), "/", ""), Len(Replace(Replace(Replace(Now, " ", "_"), ":", ""), "/", "")) - 5)
  ActiveWorkbook.SaveAs "https://placeholder.sharepoint.com/teams/Services_NL/Shared Documents/Export/" &amp; ExportSheet &amp; DateAndTime &amp; ".txt", FileFormat:=xlTextWindows
  </code></pre>