title: Trying to extract names of worksheets in workbook
body: <p>I am trying to extract names of worksheets within all excel workbooks in the folder selected. The codes doesn't run reminding type mismatch on IF row.</p>
  
  <p>I am not really familiar with FSO, object and shell function in vba so if I did anything wrong please point out, thanks.</p>
  
  <pre><code>Sub extractname()
  
      Dim Fso, Fld, sFld, Fl
      Dim Wb As Workbook, Sheeet As Worksheet, Sh As Worksheet
      Dim Arr
      Dim count As Long
  
      count = 0
  
      Application.ScreenUpdating = False
      Application.DisplayAlerts = False
  
      Set Fso = CreateObject("Scripting.FileSystemObject")
      Set Fld = Fso.getfolder(CreateObject("Shell.Application").BrowseForFolder(0, "Please select folder", 0, "").Self.Path &amp; "")
      Set Sheeet = ActiveSheet
          For Each Fl In Fld.Files
              'On Error Resume Next
              If Fl.Name Like "*.xls" Or "*.xlsm" Or "*.xlsx" Then
                  count = count + 1
                  Set Wb = Workbooks.Open(Fl)
                  ReDim Arr(count, 4)
                  Arr(count, 1) = Wb.Worksheets(1).Name.Text
                  Arr(count, 2) = Wb.Worksheets(2).Name.Text
                  Arr(count, 3) = Wb.Worksheets(3).Name.Text
                  Arr(count, 4) = Wb.Worksheets(4).Name.Text
                  Wb.Close
              End If
          Next
      Sheeet.[B65536].End(3).Resize(count, 4) = Arr
  
  End Sub
  </code></pre>
  
  <p>I expect 4 columns of worksheet names shall be tabulated but the code does not run.</p>