title: Excel VBA FSO.GetFolder(folderPath) working in 2007 but not 2010
body: <p>So I'm pretty new to VBA.  </p>
  
  <p>The below code works fine in 2007 for listing all of the <code>PDF files</code> in a particular folder.  However, this code doesn't seem to work when I try it in excel 2010 (it throws an error on <code>Set fold = fso.GetFolder(folderPath)</code>)  </p>
  
  <p>Any Ideas What I'm doing wrong?</p>
  
  <p>I do have Scripting Runtime checked. My code is below:</p>
  
  <pre><code>Sub List_files()
  
  Dim fso As FileSystemObject
  Dim fold As Folder
  Dim f As File
  Dim folderPath As String
  Dim i As Integer
  
  folderPath = "S:\Academic Affairs\Academic Operations Reporting\CV's"
  Set fso = New FileSystemObject
  Set fold = fso.GetFolder(folderPath)
  
  i = 2
  For Each f In fold.Files
      If LCase(Right(f.Name, 3)) = "pdf" Then
          Range("A" &amp; i).Value = f.Name
          i = i + 1
      End If
  Next
  
  End Sub
  </code></pre>