Excel and cell borders

Post Reply
Marc Vanzegbroeck
Posts: 1163
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Excel and cell borders

Post by Marc Vanzegbroeck »

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
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: Excel and cell borders

Post by MarcoBoschi »

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
Marc Vanzegbroeck
Posts: 1163
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Excel and cell borders

Post by Marc Vanzegbroeck »

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
Post Reply