title: VBA Verify File extension as excel file?
body: <p>I run this vba which goes through folders and pulls data which it compiles together in one big sheet. My issue is I was getting errors for hidden files called thumbs.db and I need to add something so that it verifies that it is only pulling files with xlsx extensions. Below is the code I am using.</p>
  
  <pre><code>Sub DoFolder(Folder)
      Dim SubFolder As Folder
      Dim i As Integer
      Dim CopyR As Range
  
      For Each SubFolder In Folder.SubFolders
          DoFolder SubFolder
      Next
  
      If Folder.SubFolders.Count = 0 Then
          If Folder.Files.Count = 1 Then
              If Mid(Folder.Files, Len(Folder.Files) - 3, 4) = "xlsx" Then
              Else: MsgBox "2+ files: " &amp; Folder.Path
              End If
          End If
  
          For Each File In Folder.Files
              Hoover File
          Next
      Else
      End If
  End Sub
  </code></pre>
  
  <p>The line I am having issues with figuring out is </p>
  
  <pre><code>If Mid(Folder.Files, Len(Folder.Files) - 3, 4) = "xlsx" Then
  </code></pre>
  
  <p>Any help on this would be really appreciated</p>