General information
Category:
COM/DCOM and OLE Automation
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only