Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing VFP data to Excel
Message
From
09/05/2001 10:18:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Writing VFP data to Excel
Miscellaneous
Thread ID:
00505273
Message ID:
00505273
Views:
95
I created a table with 65,000 rows (just short of Excel 2000's 65,535 limit).
The purpose was to find the fastest way to write VFP data to Excel. The
COPY TO ... XLS method only works on the first 16,383 rows of data and does not report an error.

Here are the results on a Dell 333 with 386 MB of RAM using the various techniques and saving:

1.) COPY TO (tempfile) FOX2X
oExcel.Workbooks.Open(TempFile) 9.079 and 9.468 seconds

2.) COPY TO (tempfile) CSV
oExcel.Workbooks.Open(TempFile) 11.750 and 11.688 seconds

3.) _CLIPTEXT = FILETOSTR(tempfile)
oExcel.ActiveSheet.Paste() 27.797 and 27.281 seconds

4.) Application.DataToClip(,,3)
oExcel.ActiveSheet.Paste() 72.188 and 71.515 seconds

The thing to note is that options 3 and 4 can be used to position exactly
where the data can be written to in a spreadsheet template. Of course, in
this case with 65,000 rows (an extreme case) there is not much room to
position things.

Anyway, some interesting results that may be of value to you all...
Next
Reply
Map
View

Click here to load this message in the networking platform