wks_copy

 

Description

Copy a worksheet from another worksheet.

Syntax

bool wks_copy( Worksheet & wksDesc, const Worksheet & wksSrc, int nOption = CREATE_VISIBLE, DWORD dwCtrl = DCTRL_COPY_DEFAULT )

Parameters

wksDesc
[modify] the destination worksheet
wksSrc
[input] the worksheet from which to copy
nOption
[input] Options from CREATE_TEMP, etc. default is CREATE_VISIBLE.
dwCtrl
[input] Options from DCTRL_COPY_DATA, etc (OC_const.h). default is DCTRL_COPY_DEFAULT. if the intent is to use the existing object attached to this object add the bit DCTRL_COPY_USE_EXIST_OKPTR.

Return

return true on success, else return false;

Examples

EX1

void    wks_copy_ex1()
{
    //make sure the active window is a workbook in current project
    Worksheet wks = Project.ActiveLayer();
    if ( wks )
    {
        Worksheet wksNew;
        wksNew.Create("Origin");

        if ( wks_copy(wksNew, wks, CREATE_VISIBLE_SAME) )
            printf("Success!");
        else
            printf("Fail!");
    }
}

Remark

Copy a worksheet from another worksheet

See Also

header to Included

origin.h

Reference