I've got a macro to select a file from the Open File dialog, copy the data, and paste it into a worksheet in another workbook. However, I get a runtime error 1004 at the paste step. Anyone know how to fix it?
Code:
Public Sub GetRange()
Dim ReportWbk As Workbook 'workbook with report data
Dim Report As String 'name of file with report data
Application.FileDialog(msoFileDialogFilePicker).Show
Report = Application.FileDialog(msoFileDialogFilePicker).SelectedItems(1)
Set ReportWbk = Workbooks.Open(Report)
ReportWbk.Sheets(1).Cells.Copy
Application.DisplayAlerts = False
ReportWbk.Close (False)
ThisWorkbook.Sheets("Selector to Validate").Activate
Cells(1, 1).Select: ActiveSheet.Paste
End Sub