Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy table with memo fields to an excel spreadsheet
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00212511
Message ID:
00212548
Views:
28
Colin,

You are a gentleman. Thank you very much for the tip. This is what I needed.

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
Previous
Reply
Map
View

Click here to load this message in the networking platform