General information
Category:
COM/DCOM and OLE Automation
Title:
Writing VFP data to Excel
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only