Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing VFP data to Excel
Message
From
09/05/2001 10:52:39
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
09/05/2001 10:18:14
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00505273
Message ID:
00505299
Views:
25
Tom,

Thanks for posting this. Nothing like a time trial to help one decide what method to use, especially with the added information of whether you're doing it often, or only occasionally.

I'll still be using the DataToClip() method to do my ad hoc data selections from the command window, as the time to type the rest of the commands makes those methods noticeably faster. ;-)


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

Click here to load this message in the networking platform