Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy table with memo fields to an excel spreadsheet
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00212511
Message ID:
00212537
Vues:
27
>Does anyone have a technique to copy the contents of a *.dbf file with memo fields to an Excel spreadsheet?

Use OLE Automation of excel. Here is a small example:
SELECT table

ox=CREATEOBJECT('Excel.Application')
ox.workbooks.add()

mnrowadd=0
SCAN
	ox.Activeworkbook.Worksheets(1).Cells(1+mnrowadd,1).Value=Field1
	ox.Activeworkbook.Worksheets(1).Cells(1+mnrowadd,2).Value=Field2
	ox.Activeworkbook.Worksheets(1).Cells(1+mnrowadd,3).Value=Field3
	ox.Activeworkbook.Worksheets(1).Cells(1+mnrowadd,4).Value=Field4
	ox.Activeworkbook.Worksheets(1).Cells(1+mnrowadd,5).Value=Field5
	ox.Activeworkbook.Worksheets(1).Cells(1+mnrowadd,6).Value=Field6
	mnrowadd=mnrowadd+1
ENDSCAN

ox.ActiveWorkbook.SaveAs(%filename%)
ox.Quit
RELEASE ox
HTH
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform