Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Sheet Formatting
Message
 
À
16/01/2006 00:05:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01087027
Message ID:
01087085
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>Dear Experts
>
>I use following method to export data to Excel
>
>
>SELECT master1
>COPY to C:\gin_exp.xls type xls FIELDS LIKE C*,D* EXCEPT CREDIT,DR_CR
>
>RELEASE ALL LIKE Lo*
>
>loExcel = createobject("Excel.Application")
>loWorkbook = loExcel.workbooks.open('C:\gin_exp.xls')
>loSheet = loWorkbook.sheets(1)
>
>1) How to make sheet rows height=25
>2) How to insert three blank rows at the top of loSheet
>3) How to apply following format on loSheet.Range("A7:C10")
>
>FontColor = RGB(255,0,0)
>FontSize = 12
>FontBold = .T.
>DrawBorder= "xlContinuous:xlMedium")
>
>Please Help
SELECT master1
COPY to C:\gin_exp.xls type xls FIELDS LIKE C*,D* EXCEPT CREDIT,DR_CR

RELEASE ALL LIKE Lo*
loExcel = createobject("Excel.Application")
loWorkbook = loExcel.workbooks.open('C:\gin_exp.xls')
loSheet = loWorkbook.sheets(1)

*** 1)  How to make sheet rows height=25
loSheet.Range(loSheet.Cells(1,1), loSheet.Cells.SpecialCells(xlCellTypeLastCell)).Select
loExcel.Selection.RowHeight = 25

***2)  How to insert three blank rows at the top of loSheet

FOR lnRows = 1 TO 3
    loSheet.Rows(1).Select
    loExcel.Selection.Insert(xlDown)
NEXT

*** 3)  How to apply following format on loSheet.Range("A7:C10")
loSheet.Range("A7:C10").Select

WITH loExcel.Selection.Font
     .Color = RGB(255,0,0)
     .Size = 12
     .Bold = .t.
ENDWITH
With loExcel.Selection.Borders(xlEdgeLeft)
     .LineStyle = xlContinuous
     .Weight = xlMedium
     .ColorIndex = xlAutomatic
EndWith

With loExcel.Selection.Borders(xlEdgeTop)
     .LineStyle = xlContinuous
     .Weight = xlMedium
     .ColorIndex = xlAutomatic
EndWith

With loExcel.Selection.Borders(xlEdgeBottom)
     .LineStyle = xlContinuous
     .Weight = xlMedium
     .ColorIndex = xlAutomatic
EndWith

With loExcel.Selection.Borders(xlEdgeRight)
     .LineStyle = xlContinuous
     .Weight = xlMedium
     .ColorIndex = xlAutomatic
EndWith

WITH loExcel.Selection.Borders(xlInsideVertical)
     .LineStyle = xlContinuous
     .Weight = xlMedium
     .ColorIndex = xlAutomatic
EndWith

With loExcel.Selection.Borders(xlInsideHorizontal)
     .LineStyle = xlContinuous
     .Weight = xlMedium
     .ColorIndex = xlAutomatic
EndWith
(not tested very well)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform