LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Hello,I am Giuseppina and I write to you from Italy. I have some problems with Excel 97 library. I am developing a tool in C that uses Excel to generate some tables of datas, charts


and I would like to page these objects .
For doing this, I use the function Excel_HPageBreaksAdd but i have some problem .
The application answers me that does not found the member . /*open new Range for Worksheet*/
error = CA_VariantSetCString (&MyCellRangeV,"A56");
error = Excel_WorksheetRange(ExcelWorksheetHandle, NULL,MyCellRangeV,CA_DEFAULT_VAL, &ExcelRangeHandle);
if (error<0) goto Error;

Excel_RangeActivate(ExcelRangeHandle, NULL);
error = Excel_HPageBreaksItem(ExcelHPageBreaksHandle,NULL,1,&ExcelHPageBreakHandle);
error = E
xcel_HPageBreaksAdd(ExcelHPageBreaksHandle,NULL,ExcelRangeHandle, &ExcelHPageBreakHandle);
if (error<0) goto Error;
0 Kudos
Message 1 of 2
(2,767 Views)
You didn't say where you are getting the ExcelHPageBreaksHandle handle for the HPageBreaks collection. What you would have to do is get the HPageBreaks collection from the WorksheetObject, then Add a page break to it. Somthing like this:


CA_VariantSetCString (&MyCellRangeV,"A56");
Excel_WorksheetRange(ExcelWorksheetHandle, NULL,MyCellRangeV,CA_DEFAULT_VAL, &ExcelRangeHandle);

Excel_GetProperty (ExcelWorksheetHandle, NULL, Excel_WorksheetHPageBreaks, CAVT_OBJHANDLE, ExcelHPageBreaksHandle);
Excel_HPageBreaksAdd(ExcelHPageBreaksHandle,NULL,ExcelRangeHandle, &ExcelHPageBreakHandle);

This would add a horizontal page break before the "A56".

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 2 of 2
(2,767 Views)