2.2.4.47.3 WorksheetPage::GetExcelCOMObject

Description

Assuming the WorksheetPage contains an embedded Excel workbook, it returns the COM object associated with the Excel workbook, which allows direct COM programming of the Excel workbook.

Syntax

BOOL GetExcelCOMObject( Object & obj )

Parameters

obj
[output]the variable that will receive the Excel workbook COM object embedded in the WorksheetPage.

Return

TRUE if success, otherwise FALSE.

Examples

EX1

int WorksheetPage_GetExcelCOMObject_ex1()
{
    WorksheetPage wkbk("Book1");    // assumes that there exists an Excel window with the name "Book1"
                                    // inside the project.
    Object objExcelWkbk;
    BOOL bSuccess = wkbk.GetExcelCOMObject(objExcelWkbk); 
    if (bSuccess)
        out_str("Succeeded!");
    else
        out_str("Failed!");
    return (int)bSuccess;
}

Remark

See Also

WorksheetPage::ExcelSheet, WorksheetPage::OpenExcel

Header to Include

origin.h