I have the following code to copy data between 2 different excel files
xlRangeSource = xlsheetSource.Range("B2:K" & IntAmountOfRows)
xlRangeTarget = xlsheetTarget.Range("A" & intStartOfEmptyRow)
xlRangeSource.Copy(Destination:=xlWbTarget.Worksheets(xlsheetTarget).range(xlRangeTarget))
IntAmountOfRows
and intStartOfEmptyRow
are both integers
When executing my code, I get the following error:
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
However, I am using a range to copy to a range. I don't understand why the types are a mismatch
User contributions licensed under CC BY-SA 3.0