Hi,

this is probably because the used range in the second excel workbook is greater than it appears at first sight.

Press Ctrl+End and see where it takes you. If it takes you to a cell that is way below the last one occupied, you should select the seemingly empty cells and clear all/delete the column/row.

Re-running the macro after that should work properly