title: VBA Macro cannot find folder path
body: <p>I have written a macro (with the help of several internet sources) that will iterate through files in a SharePoint folder online and extract the needed info out of said folder, then move onto the next. </p>
  
  <p>However, it does not seem to locate the folder path and produces an error telling me it cannot locate folder path. I have checked the path by copying and pasting the folder into google chrome and it works. </p>
  
  <p>I'm sure this will be a silly and stupid fix but i cannot seem to get it to work. </p>
  
  <pre><code>Sub ExtractComments()
  
  Dim mswb, slwb As Workbook
  Dim mscommentsws, mssheetsenteredws, slcommentsws, slcoverpagews As Worksheet
  Dim mscommentswslrow, mssheetsenteredwslrow, slcommentswslrow As Long
  Dim folderURL As String
  Dim fso As FileSystemObject
  Dim folder As folder
  Dim file As file
  
  
  folderURL = InputBox("Please enter Sharepoint link of the Internal VV folder")
  
  If folderURL = vbnullstirng Then Exit Sub
  
  Set fso = New FileSystemObject
  
  If Not fso.FolderExists(folderURL) Then
      MsgBox ("Folder does not exist")
      Exit Sub
  Else
  Set folder = fso.GetFolder(folderURL)
  End If
  
  Set mswb = ThisWorkbook
  Set mscommentsws = mswb.Sheets("AllComments")
  Set mssheetsenteredws = mswb.Sheets("SheetsEntered")
  
  mscommentswslrow = mscommentsws.Range("D" &amp; Rows.count).End(xlUp).Row
  mssheetsenteredwslrow = mssheetsenteredws.Range("A" &amp; Rows.count).End(xlUp).Row
  
  For Each file In folder.Files
  
      Set slwb = Workbooks.Open(folderURL &amp; file.Name)
      Set slcommentsws = slwb.Sheets("Comments")
      Set slcoverpagews = slwb.Sheets("Cover Page")
  
      Dim fileURLrange, URLname As Variant
      Dim count As Long
  
      slcommentswslrow = slcommentsws.Range("E" &amp; Rows.count).End(xlUp).Row
  
      fileURLrange = mssheetsenteredws.Range("A1:A" &amp; mssheetsenteredwslrow)
      URLname = f.Name
  
  </code></pre>