I am having trouble with a seemingly easy transaction. The user is prompted to open an Excel sheet with data and select the entire worksheet before copying the data. Then they go to the macro workbook (different workbook) where they trigger the macro which should paste the data from the clipboard into the new workbook (followed by compiling etc.) The issue is that I can't get the data to paste from the clipboard into the new workbook. I have the below code, which returns "1004 - Paste Method of Worksheet class failed." Any help to resolve this seemingly easy problem is greatly appreciated.
VBA Code:
Sub CompileData()
Sheets("MB51 Data").Activate
Cells.Select
ActiveSheet.Paste
ActiveWorkbook.Worksheets("MB51 Data").Rows("1:2").Delete Shift:=-4162
End Sub