WorksheetPage::SaveExcelInOpj

Description

Origin can save the excel data in OPJ file and is loaded internally on load. When called on a excel page, this function enables or disables such saving as requested.

Syntax

BOOL SaveExcelInOpj( BOOL bSave = TRUE, BOOL bAutoUpdate = TRUE )

Parameters

bSave
[input]When true, origin will save excel data in the opj file.
bAutoUpdate
[input] not used when bSave = TRUE; when bSave is FALSE, this parameters decides if origin should automatically update the external excel file. bAutoUpdate = TRUE will automatically update the linked excel file.

Return

TRUE if success, otherwise FALSE.

Examples

EX1

// For this example, Open a existing Excel in Origin
void  WorksheetPage_SaveExcelInOpj_ex1(string     strPathNameToSave = "c:\\proj.opj")
{
    WorksheetPage wp = Project.Pages();
    
        //If bSave = FALSE, bAutoUpdate = TRUE will automatically update the linked excel file if original Excel changed. 
    wp.SaveExcelInOpj(FALSE, TRUE); 
    
        Project.Save(strPathNameToSave);
}

Remark

See Also

WorksheetPage::ExcelSheet, WorksheetPage::OpenExcel

header to Include

origin.h