Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export data to Excel
Message
From
09/05/2001 02:47:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/05/2001 13:39:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00504835
Message ID:
00505147
Views:
23
I believe Tom :)
That was the technique used in slower version to gain some speed in the thread I pointed.
More than that with datatoclip() if it's Excel you have limitations not only max array size but how much rows you could copy. Changing from computer to computer (sounds related with RAM) you could only copy 2-3K rows at a time (even if you had more to hit max array size). Datatoclip() also adds an unnecessary extra column to data.
Actually I think fastest would be to create an xls at lowlevel but who would deal with revealing an xls file format :)
Cetin

>Believe it or not, but the following is actually faster than DataToClip()
>especially for a large number of rows:
>
>
>COPY TO filename DELIMITED WITH TAB
>_CLIPTEXT = FILETOSTR(filename)
>oExcel.ActiveSheet.Paste()
>_CLIPTEXT = “” && clear out the clipboard
>
>
>>Automation will do it, but I think the limit then is 64K. After that you will need additional sheets or workbooks.
>>
>>A fast way is to select an amount of data and then use
>>_VFP.DataToClip( , , 3)
>>oExcel.Paste()
>>
>>This makes an array, and you are limited by the max size of an array so if you have a lot of columns you will need to paste fewer rows at a time.
>>
>>Another method is to COPY TO with a small piece at a time and Workbooks.Add() each piece.
>>
>>A third way is to copy to a DBF and automate opening that and saving as an XLS.
>>
>>>HI,
>>>I have queries that may contain 100-500k of rows. I want to export them in Excel. I tried COPY TO...TYPE XL5. It only copy 16383 rows. I know that Excel is able to hold more than that. Is there another solution for it ? Ole automation surely ?
>>>
>>>Thank you,
>>>Christian Cote
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform