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
Excel and cell borders
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Excel and cell borders
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- MarcoBoschi
- Posts: 1071
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: Excel and cell borders
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
[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
info@marcoboschi.it
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Excel and cell borders
Thanks Marco for the quick responce.
I will try it.
Regards,
Marc
I will try it.
Regards,
Marc
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite