Ole and Insert Page Break

Ole and Insert Page Break

Postby Jack » Wed Oct 01, 2008 9:18 am

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

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

Thanks
Jack
 
Posts: 280
Joined: Wed Jul 11, 2007 11:06 am

Re: Ole and Insert Page Break

Postby Enrico Maria Giordano » Wed Oct 01, 2008 9:40 am

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8330
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Jack » Thu Oct 02, 2008 12:18 pm

Thanks, it works .

Where did you find the syntax about OLE ?

Thanks .
Jack
 
Posts: 280
Joined: Wed Jul 11, 2007 11:06 am

Postby Enrico Maria Giordano » Thu Oct 02, 2008 3:43 pm

Jack wrote:Thanks, it works .

Where did you find the syntax about OLE ?

Thanks .


VBA*.CHM or MSDN.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8330
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 9 guests