LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

HOw to set up the excel page layout in A4 format with Excel_SetProperty

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

 

0 Kudos
Message 1 of 2
(152 Views)

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.

 

0 Kudos
Message 2 of 2
(94 Views)