Hi Everybody,
Does anyone know how to force a "Page Break" in Excel via FW ?
Thanks,
Jeff
Thanks,
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)
Hi Everybody,
Does anyone know how to force a "Page Break" in Excel via FW ?
Thanks,
Jeff
#define xlPageBreakManual -4135
#define xlPageBreakNone -4142
FUNCTION MAIN()
LOCAL oExcel := CREATEOBJECT( "Excel.Application" )
LOCAL oSheet
oExcel:WorkBooks:Add()
oSheet = oExcel:ActiveSheet
oSheet:Cells( 1, 1 ):Value = "This is the first page"
oSheet:Rows( 2 ):PageBreak = xlPageBreakManual
oSheet:Cells( 2, 1 ):Value = "This is the second page"
oExcel:Visible = .T.
RETURN NILJeff Barnes wrote:What does the xlPageBreakNone do?
I figured that out as soon as I hit the send button
Thanks Enrico.
Jeff
FUNCTION MAIN()
LOCAL oExcel := CREATEOBJECT( "Excel.Application" )
LOCAL oSheet
oExcel:WorkBooks:Add()
oSheet = oExcel:ActiveSheet
oExcel:ActiveWindow:View := 2
// View = 2 sets excel to page break preview mode.
oSheet:ResetAllPageBreaks()
nTotalBreaks := oSheet:HPageBreaks:Count()
for nCounter := 1 to nTotalBreaks
oPageBreak := oSheet:HPageBreaks[nCounter] // This Works
do case
case nCounter = 1
cCells := 'A'+alltrim(str(nMyFirstBreak))
case nCounter = 2
cCells := 'A'+alltrim(str(nMySecondBreak))
endcase
oPageBreak:location := oSheet:Range( cCells )
next
return nil