hello guys,
I am filling a VFP table into an Excel sheet.
I would like to have borders in it.
I am not being able to find the right code for this.
I tried to save the command as macro but with no success this is what I got..
how to translate this to VFP Code ?
**************************
Range("B5:F5").Select
Selection.Borders(xlDiagon
alDown).Li
neStyle = xlNone
Selection.Borders(xlDiagon
alUp).Line
Style = xlNone
With Selection.Borders(xlEdgeLe
ft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTo
p)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBo
ttom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRi
ght)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInside
Vertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInside
Horizontal
)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
**************************
This is basically what I am doing now :
PROCEDURE FillXLS
***************
PARAMETERS mFile
xlapp = GetObject('','Excel.Applic
ation')
xlapp.visible = .t.
xlworkbook = xlapp.Workbooks.Open("C:\T
emplate.xl
s")
xlsheet = xlworkbook.Sheets(1)
mCell=4
SELECT _tmp
GO top
SCAN
SELECT _tmp
mCell=mCell+1
SELECT _tmp
STORE BRAND TO mBrand
STORE ITEMCODE TO mItem
STORE DESCRIPT TO mName
STORE QTE TO mQte
STORE SALESPRICE TO mTotal
xlsheet.Range("B"+ALLTRIM(
STR(mCell)
)).Value=m
Brand
xlsheet.Range("C"+ALLTRIM(
STR(mCell)
)).Value=m
Item
xlsheet.Range("D"+ALLTRIM(
STR(mCell)
)).Value=m
Name
xlsheet.Range("E"+ALLTRIM(
STR(mCell)
)).Value=m
Qte
xlsheet.Range("F"+ALLTRIM(
STR(mCell)
)).Value=m
Total
SELECT _tmp
ENDSCAN
xlworkbook.SaveAs(mFile)
xlworkbook.close
xlapp.quit
RETURN
what I need is to make the table "nice"
so I fixed the font name and size in the template.xls and the format and everything..
now I need the borders of the table too..
I can not do this in the template since this will change from table to table...(numbers of rows...)
I also have a slight problem with the totals... for now I am inserting it at the top of the page too..
since I can not know too when the table will end...
any other idea ?
thanks