Sub CheckSSR()
Dim CD As Workbook
Dim OD As Worksheet
Dim CA As String
Dim F As String
Dim CS As Workbook
Dim OS As Worksheet
Dim endA As Integer
Dim endC As Integer
Dim DEST As Range
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Set CD = ThisWorkbook
Set OD = CD.Worksheets("SSR")
OD.Visible = True
endA = OD.Cells(Application.Rows.Count, "A").End(wlup).Row
If endA < 2 Then endA = 2
OD.Range("A2:G" & endA).ClearContents
CA = "F:\xxxxxxxxxxxxx"
F = Dir(CA & "\", vbReadOnly)
Do While F <> ""
On Error Resume Next
Set CS = Workbooks.Open(CA & "\" & F, UpdateLinks:=False)
If Err <> 0 Then
Err.Clear
GoTo fin
End If
On Error GoTo 0
Set OS = CS.ActiveSheet
endC = OS.Range("A2").End(xlDown).Row
Set DEST = OD.Cells(Application.Rows.Count, "A").End(xlUp).Offset(1, 0)
OS.Range("A2:G" & endC).Copy DEST
OD.DEST.Offset(0, 7).Value = F
CS.Close False
fin:
F = Dir
Loop
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub