Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transfer Foxpro database to Excel
Message
De
22/03/2002 18:49:35
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00636342
Message ID:
00636352
Vues:
21
Currently I am using Visual Foxpro 5.0.
Here is the source code work with on sheet only on Excel

tmpsheet = GetObject('',"Excel.Sheet")

XLApp = tmpsheet.application

XLApp.Visible = .T.
XLApp.WorkBooks.Add()
s=1
XLSheet = XLApp.ActiveSheet
Sele 0
Use (mFile) Alias FileExcel
Go Top
xline=4
xTotal=0
Do While !Eof()
xTotal=xtotal+Val(extncost)
FOR xi = 1 to Fcount()
xiField=Field(xi)
If Type(Allt(xiField))='N'
XLSheet.Cells(D,xi).Value = Allt(Str(&xiField,12,2))
Else
XLSheet.Cells(D,xi).Value = Allt(&xiField)
Endif
ENDFOR
D=D+1
Skip
Enddo
XLSheet.Cells(D,3).Value = "Total Cost"
XLSheet.Cells(D,8).Value = Allt(Str(xtotal,12,2))
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform