title: create folder in sharepoint document library using VBA
body: <p>I am trying to create a folder in sharepoint Documents library using Excel VBA. Here is my code which is not working</p>
  
  <pre><code> Sub CreateFolder_SP()
  
   Dim strURL As String
  
  ''Copy and paste the URL of your sharePoint folder where you want to create another folder
  
    strURL = "http://sharepoint link/"
  
   'strURL = Replace(strURL, "http:", "") //// have also tried this
  
   strURL = Replace(Replace(strURL, "http:", ""), "/", "\")
  
  Dim Fld_r As String
  
   Fld_r = "Test"
   Fld_r = Replace(Fld_r, Chr(9), " ")
  
   If Len(Dir(strURL &amp; Fld_r, vbDirectory)) = 0 Then ''' I am getting run-time error here bad File name or number or sometimes path not found
    MkDir (strURL &amp; Fld_r)
    DoEvents
  
   End If
   End sub
  </code></pre>