Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble when exporting to Excel
Message
De
10/01/2001 18:03:33
 
 
À
10/01/2001 17:55:00
Fausto Garcia
Independent Developer
Lima, Pérou
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00461973
Message ID:
00461978
Vues:
35
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform