| DataObject::ExecuteFormulaExecuteFormula DescriptionTrigger the execution of Column/MatrixObject formula For Origin version 8 or later. Syntax
BOOL ExecuteFormula( int nBegin = -1, int nEnd = -1, BOOL bUndo = TRUE, int nC1 = -1, int nC2 = -1, DWORD dwCtrl = 0, UINT nColRepeatCount = 0, UINT nRefColUID = 0 )
 Parameters
    nBegin[input] begining row index (0 based), <0 indicate the first row; default is -1.nEnd[input] end row index (0 based), <0 indicate the last row; default is -1.bUndo[input] if this parameter is TRUE (by default) method can be undone.nC1[input] start col index (0 based), <0 indicate the first col; default is -1.nC2[output] end col index (0 based), <0 indicate the last col; default is -1.dwCtrl[input] control options enumerated as EXEC_FORMULA_*nColRepeatCount[input] internal usenRefColUID[input] internal use ReturnTRUE on success and FALSE on failure. ExamplesEX1 
// Create a worksheet with column formulas in place and execute
void    DataObject_ExecuteFormula_Ex1()
{
    Worksheet wks;
    wks.Create("origin", CREATE_VISIBLE);
    Column col;
    col.Attach(wks, 0);
    col.SetFormula("5*(i-1)");
    BOOL bRet = col.ExecuteFormula();
}
EX2 
 
void     DataObject_ExecuteFormula_Ex2()
{
        MatrixPage mp;
    mp.Create("origin");
    MatrixLayer ml = Project.ActiveLayer();
    MatrixObject moMy(ml, 0);
    if(moMy)
    {
        moMy.SetFormula("i*i");
        moMy.ExecuteFormula(0,-1, TRUE, 2,4);
    }
}
RemarkMust call SetFormula the set the formula before ExecuteFormula. See AlsoDataObject::GetFormula, DataObject::SetFormula header to Includeorigin.h |