I'm using copy(Destination:=) and would like to copy whole records in one excel to another excel file but failed to execute. Could it because of need to use range? Because there is not necessary to use range as i would like to copy all and paste into another excel file
oWorkBook.Sheets(1).Cells.Copy(Destination:=oWorkBookOri.Sheets(1).Range("A" & oWorkBookOri.Sheets(1).UsedRange.SpecialCells(XlCellType.xlCellTypeLastCell).Row + 1))
It mentioned error as below.
"Copy method of Range class failed".
My Previous code are as below
oWorkBook.Sheets(1).Cells.Copy()
oWorkBookOri.Sheets(1).Range("A" & oWorkBookOri.Sheets(1).UsedRange.SpecialCells(XlCellType.xlCellTypeLastCell).Row + 1).Select()
oWorkBookOri.Sheets(1).Paste
and it keep occur error message "System.Runtime.InteropServices.COMException (0x800A03EC): Paste method of Worksheet class failed" and despite on this, i changed to copy destination syntax and occur error as mentioned above.