Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export from VFP to Excel
Message
 
To
17/04/2003 13:55:52
Van Son Nguyen
Dessau Soprin Inc.
Laval, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00778968
Message ID:
00778983
Views:
40
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform