I changed:
PHP Code: 
                    .Cells(LR"z").Resize(UBound(a)) = ws.Name 
to
PHP Code: 
                    .Cells(LR"z").Resize(UBound(a)) = FileName.Name 
and it works fine.
But still only first 2 raws of the workbooks are pasted.