Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble when exporting to Excel
Message
From
10/01/2001 18:03:33
 
 
To
10/01/2001 17:55:00
Fausto Garcia
Independent Developer
Lima, Peru
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00461973
Message ID:
00461978
Views:
36
>Hello,
>
>We often use the COPY TO ... TYPE XL5 command to export the content of VFP cursors and tables to Excel worksheets. Lately we have seen that these worksheets had a maximum of 16384 rows although our cursors have more than that.
>Is there any limit to the total count of rows VFP can export? We use VFP 5.0
>
>Fausto

Yes. 16384. You can use DATATOCLIP and paste segments to get more total rows via automation.


Say you can get 5,000 records into the clipboard at one time out of 75000:

oExcel = CREATEOBJECT("Excel.Application")
oExcel.Sheets("Sheet1").Select()
nMaxRecs = 5000
SELECT * FROM yourtable ;
WHERE whateveryouneed ;
INTO CURSOR temp1 NOFILTER
nTotal = _TALLY
nSegment = INT(nTotal/nMaxRecs)
FOR x=1 TO nSegment
nStart = (x-1) * nMaxRecs + 1
nEnd = x * nMaxRecs
SELECT * FROM temp1 ;
WHERE BETWEEN(RECNO(),nStart,nEnd) ;
INTO CURSOR temp2
_VFP.DATATOCLIP(,,3)
oExcel.ActiveSheet.Cells(nStart, 1).Select()
oExcel.ActiveSheet.Paste()
ENDFOR
oExcel.ActiveWorkbook.Save()
oExcel.ActiveWorkbook.Close()
oExcel.Quit()
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform