FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Excel and cell borders
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Excel and cell borders
Posted: Mon May 14, 2012 12:45 PM

Hello,

I create so excel-files from FWH, but want also set cell-borders.
Does anyone know how to define the cell-border in excel from FWH.
Also, only adding the upper-border, left-border,...

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Excel and cell borders
Posted: Mon May 14, 2012 01:42 PM
marco try this little sample:

[code]
#include "fivewin.ch"


// Line styles

#define xlContinuous 1
#define xlDash -4115
#define xlDashDot 4
#define xlDashDotDot 5
#define xlDot -4118
#define xlDouble -4119
#define xlSlantDashDot 13
#define xlLineStyleNone -4142


// Border positions

#define xlEdgeLeft 7
#define xlEdgeTop 8
#define xlEdgeBottom 9
#define xlEdgeRight 10

FUNCTION MAIN()
LOCAL oExcel
LOCAL oAs

oExcel := CreateObject( "Excel.Application" )

oExcel:WorkBooks:Add()

oAS := oExcel:ActiveSheet()

oAs:Range( "C10" ):Value := "Marco"
oAs:Range( "C10" ):Borders( xlEdgeTop ):LineStyle := xlContinuous
oAs:Range( "C10" ):Borders( xlEdgeLeft ):LineStyle := xlContinuous
oAs:Range( "C10" ):Borders( xlEdgeBottom ):LineStyle := xlContinuous
oAs:Range( "C10" ):Borders( xlEdgeRight ):LineStyle := xlContinuous


oExcel:visible := .T.

RETURN NIL
Marco Boschi
info@marcoboschi.it
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: Excel and cell borders
Posted: Mon May 14, 2012 01:53 PM

Thanks Marco for the quick responce.

I will try it.

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion