Information générale
Catégorie:
COM/DCOM et OLE Automation
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...
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement