Excel: Error '1004' & '13' Copying Range from Another Open Workbook.


I'm building a macro within one workbook, to open another WB and copy a range of data, then go back to the original WB and paste the results. With the code below, I get a '1004' error (application or object defined error):


WB.Sheets(NAME).Range(Cells(copyFrom, START_COL), Cells(copyTo, END_COL)).Select
Selection.Copy
After researching '1004' errors, I tried the code below, but now get a '13' error (type mismatch):

Dim copy_rng as Range
Set copy_rng = WB.Sheets(NAME).Range("A" & copyFrom).Resize(copyTo, END_COL)
Other information you may need: WB is defined as Excel.Workbook, the 2nd workbook I'm trying to copy from. CopyFrom, copyTo and END_COL contain integers. NAME is a string variable or the tab name. Any thoughts?


This question generated 27 answers. To proceed to the answers, click here.

This thread is current as of December 12, 2013.


For more resources for Microsoft Excel