05-03-2025 05:23 AM
Hello,
I am handling excel sheet in my CVI code using the Excel_rpt api.
ExcelRpt_ApplicationNew(0, &applicationHandle);
ExcelRpt_WorkbookNew(applicationHandle, &workbookHandle);
ExcelRpt_WorksheetNew(workbookHandle, -1, &worksheetHandle);
I want to configure the page layout as A4.
I am using the Excel_SetProperty function, but it does not work,
Excel_SetProperty (workbookHandle, NULL, Excel_PageSetupPaperSize, CAVT_VARIANT,CA_VariantInt(ExcelConst_xlPaperA4))
Does any one has ever try to do such configurqtion?
Thank you
05-05-2025 03:03 AM
Hi,
I'm not an expert in CVI but I think that you are applying the Excel_SetProperty at the wrong location.
When using the Excel Report (ExcelRpt) API in LabWindows/CVI, setting the paper size should be done on the worksheet's PageSetup object, not on the workbook.
Tell me if it helps you or if you would require more help.