05-28-2009 01:02 PM
05-29-2009 08:40 AM - edited 05-29-2009 08:41 AM
Hi Axinia,
you need to create a valid Excel workbook handle that refers to a unique spreadsheet.
I recommend you take a look at the Excel examples that are shipped with CVI (Help->Find Examples, search for "Excel").
Here, the handles are created as follows:
static CAObjHandle applicationHandle = 0;
static CAObjHandle workbookHandle = 0;
static CAObjHandle worksheetHandle = 0;// and later
ExcelRpt_ApplicationNew(1, &applicationHandle);
ExcelRpt_WorkbookNew(applicationHandle, &workbookHandle);
ExcelRpt_WorksheetNew(workbookHandle, -1, &worksheetHandle);
This should provide you with a valid handle for subsequent workbook operations.
I hope this helps. Let us know if this works for you.
Best regards,
Peter