The error occurs in this line:
Workbooks.Open (MyFile)
because MyFile contains only file name without its path!
Try this:
Sub LoopThroughDirectory()
Dim sFile As String, sPath As String, eRow as Integer
Dim srcWbk As Workbook, dstWbk as Workbook
Dim srcWsh As Worksheet, dstWsh as Worksheet
Set dstWbk = ThisWorkbook
Set dstWsh = dstWbk.Worksheets("Sheet1")
sPath = "C:\Users\SJPM\Desktop\Sal\"
sFile = Dir(sPath)
Do While sFile<>""
If MyFile = "zmaster.xlsm" Then
Exit Do
End If
Set srcWbk = Application.Workbooks.Open(sPath & MyFile)
Set srcWsh = Worksheets("Final Salary")
eRow = dstwsh.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
srcWsh.Range("B22:E32").Copy dstWsh.Range(Cells(erow, 1), Cells(erow, 4))
srcWbk.Close SaveChanges:=False
MyFile = Dir()
Loop
dstWbk.Close SaveChanges:=True
End Sub
Note: you have to change above code to your needs!