Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transfer Foxpro database to Excel
Message
From
22/03/2002 18:49:35
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00636342
Message ID:
00636352
Views:
20
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))
Previous
Reply
Map
View

Click here to load this message in the networking platform