Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Export from VFP to Excel
Message
 
À
17/04/2003 15:50:45
Van Son Nguyen
Dessau Soprin Inc.
Laval, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00778968
Message ID:
00779054
Vues:
35
Looks like you have VFP5, do you? Otherwise I cannot explain error on /wait wind nowa trans(recn())/

Code may not work in VFP5 at all; at least I did not test it. Still you may use it as a idea.
Additionally, depending on the Excel version there could be 65000 records added to the sheet (nrec=65000 below).

>Hello Yuri,
>I just did some tests with your suggested program and here are some results:
>
>- wait wind nowa trans(recn()) : fewer parameters than expected ?
>
>- _VFP.Datatoclip(,lnrec,3) : VFP gave me the following error message "VFP.exe has generated errors and will be closed by windows. You will need to restart the program. An error log is been created" (I don't know where !)
>
>The remainning seems OK
>
>Do you have any idea ?
>
>*********Original program************
>Something like this will allow you to create multi-sheets document. Change lnrec as you need (but no more than 16000).
>
>sele (pcAlias)
>
>go top
>outfile="c:\"+alias()+".xls"
>
>ObjExcel= CREATEOBJECT("Excel.Application")
>with ObjExcel
>.DisplayAlerts = .f.
>* .visible=.t.
>.Workbooks.add()
>endwith
>
>isheet=0
>lnrec=16000
>
>do while not eof()
>isheet=isheet+1
>wait wind nowa trans(recn())
>_VFP.Datatoclip(,lnrec,3)
>with ObjExcel
>if .Sheets.Count .Worksheets.add(,.sheets(isheet-1))
>endif
>.Sheets(isheet).Activate
>.Range("a1").Select
>.ActiveSheet.Paste()
>endwith
>skip lnrec
>enddo
>
>ObjExcel.Workbooks(1).SaveAS(outfile)
>ObjExcel.quit
>ObjExcel= .NULL.
>release objexcel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform