Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

export to excel 2007

193 views
Skip to first unread message

Sunny

unread,
Feb 11, 2009, 1:15:04 PM2/11/09
to
I tried to search but could not find exact answer. I am using FoxPro 9.0 and
have excel 2007. I know excel 2007 can hold over 1 M rows but foxpro can not
export more than 65000 records. Is there any work around?


Tom Libby

unread,
Feb 11, 2009, 2:41:49 PM2/11/09
to
You will have to use automation.

This should get you started.

LOCAL loExcel as "Excel.Application"
LOCAL loWrkBook AS "Excel.WorkBook"
LOCAL loSheet AS "Excel.Sheet"

loExcel = CREATEOBJECT("Excel.Application")
loExcel.DisplayAlerts = .F.
loExcel.Visible = .F.

loWrkBook = loExcel.Application.Workbooks.Add()
loSheet = loWrkBook.Sheets(1)
liRow = 0
SCAN
liRow = liRow + 1
lcRow = TRANSFORM(liRow)
loSheet.Range("A"+lcRow) = field1
loSheet.Range("B"+lcRow) = field2
loSheet.Range("C"+lcRow) = field3
ENDSCAN

loWrkBook.SaveAs("c:\temp\Excelfile")
loExcel.Visible = .T.

loSheet = .NULL.
loWrkBook = .NULL.
loExcel = .NULL.

"Sunny" <sunny...@hotmail.com> wrote in message
news:uiqmqSHj...@TK2MSFTNGP06.phx.gbl...

Sunny

unread,
Feb 11, 2009, 3:00:00 PM2/11/09
to
Thanks it worked.
"Tom Libby" <tli...@bigblue-usa.com> wrote in message
news:uQYbKDIj...@TK2MSFTNGP03.phx.gbl...

Gerhard Gentele

unread,
Mar 26, 2009, 9:56:31 AM3/26/09
to
It's very simple. A couple off monts ago i found the answer here in the
usergroup:

*** In addition to what others have mentioned to you -

*** I usually export / copy to type FOX2X, then

*** have EXCEL OPEN IT NATIVELY as a dbf file

*** sample:

use testdata

export to testdata2 type fox2x

*** now you can open testdata2 with nearly every EXCELL version.

it worked fine and without limits

Greetings: Gerhard Gentele


0 new messages