FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Ole and Insert Page Break
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Ole and Insert Page Break
Posted: Wed Oct 01, 2008 09:18 AM

I want to insert a page break in a excell sheet with ole
What is the instruction ??

oSheet:HPageBreaks:Add("Before") ???

Thanks

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Ole and Insert Page Break
Posted: Wed Oct 01, 2008 09:40 AM
#define xlPageBreakManual -4135


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 NIL


EMG
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Ole and Insert Page Break
Posted: Thu Oct 02, 2008 12:18 PM

Thanks, it works .

Where did you find the syntax about OLE ?

Thanks .

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Ole and Insert Page Break
Posted: Thu Oct 02, 2008 03:43 PM
Jack wrote:Thanks, it works .

Where did you find the syntax about OLE ?

Thanks .


VBA*.CHM or MSDN.

EMG

Continue the discussion