Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Export from VFP to Excel
Message
 
À
17/04/2003 13:55:52
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:
00778983
Vues:
39
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=60000

do while not eof()
	isheet=isheet+1
	wait wind nowa trans(recn())
	_VFP.Datatoclip(,lnrec,3)
	with ObjExcel 
		if .Sheets.Count<isheet
			.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