Hi,
Perhaps you can try this example:
void Worksheet_CopyTo_Ex2()
{
Worksheet wksSource = Project.ActiveLayer();
if( wksSource )
{
int nC1 = 0, nC2 = -1;
// The source ending row (nR2) is exclusive
int nR1 = 2, nR2 = 4;
//Copy to the worksheet starting at the 12th column
int nDestR1 = 12;
DWORD dwCtrl = CPYT_APPEND_BY_ROW | CPYT_ALLOW_SAME_LAYER_IF_NOT_INTERSECT;
int nRet = wksSource.CopyTo(wksSource, nC1, nC2, nR1, nR2, 0, -1, dwCtrl, nDestR1);
}
}
Hope this can be some help.
Regards,
Yuki
OriginLab