Quote Originally Posted by snb View Post
Reduce the code to:

Sub M_snb()
  redim sp(2000,4)

  with Application.FileDialog(4)
    if .show then
      c00 = .selecteditems(1) & "\"
      c01 = dir(c00 & "*.xls*")

      Do until c01 = ""
        with getobject(c00 & c01)
          sn =.sheets(1).range("A1:C27")
          .close 0
        end with

        for j = 1 to 5
          sp(n,j-1) = sn(choose(j,3,17,21,23,27),iif(j = 1,2,3))
        next

        n = n+1
        c01 = Dir
      Loop

      sheet1.cells.unmerge
      sheet1.cells(rows.count,1).end(xlup).offset(1,1).resize(ubound(sp),5) = sp
    end if
  end with 
End Sub
Thanks, but the code cannot run.
I received a run-time error '432': File name or class name not found during Automation operation at
with getobject(c00 & c01)