Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining XLS Sheets
Message
 
To
25/11/2002 15:57:44
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00726491
Message ID:
00726659
Views:
20
You can add records up to 65000 in the sheet or add sheets as needed.
Something like this:

use yourtable
lnrec=30000
ObjExcel= CREATEOBJECT("Excel.Application")
with objExcel
.Workbooks.add()
.Range("a1").Select
_VFP.Datatoclip(,lnrec,3)
.ActiveSheet.Paste()
.....

OR

use yourtable
outfile="c:\hello.xls"

ObjExcel= CREATEOBJECT("Excel.Application")
ObjExcel.Workbooks.add()

isheet=0
lnrec=5000
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



>When I copy to a new worksheet from a cursor it will only copy about 16,000 of the rows. I have over 30,000 to copy what do I do then?
Previous
Reply
Map
View

Click here to load this message in the networking platform