Excel and cell borders

Excel and cell borders

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

Re: Excel and cell borders

Postby MarcoBoschi » Mon May 14, 2012 1: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Excel and cell borders

Postby Marc Vanzegbroeck » Mon May 14, 2012 1: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests