>I am using VFP 5 to control Excel. I have been
>attempting to use the Macro recorder to provide
>some help, but now I am stuck.
>
>All I want to do is select a portion of a row
>(say B3:B10) and add a continious line to the top
>edge of this selected area.
>
>The code from Excel returned the following:
>
> Range("B3:B10").Select
> With Selection.Borders(xlEdgeTop)
> .LineStyle = xlContinuous && value of a 1
> .Width = xlThin && value of a 2
> .ColorIndex = xlAutomatic && value of -4105
> EndWith
>
>What is the value of xlEdgeTop? Not sure this syntax
>will port to VFP. anyone know how to draw a solid
>line through a selected area in Excel using VFP?
Syntax ports to VFP nearly same :
#define xlEdgeBottom 9
#define xlEdgeLeft 7
#define xlEdgeRight 10
#define xlEdgeTop 8
#define xlContinuous 1
#define xlThin 2
#define xlAutomatic -4105
cMyxlsfile="\my documents\fiat.xls"
oexcel = createobject("Excel.application")
with oExcel
.visible = .t.
.workbooks.open(cMyxlsfile)
.activeworkbook.worksheets(1).Range("B2:M2").Select
with .Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
EndWith
endwith
All office constants are in wc0993.exe at MS site (don't know exact place).
Cetin