Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import an excell file into a FoxPro table

Status
Not open for further replies.

achen

Programmer
Jul 21, 2000
11
US
I tried to import an excell file to create a new FoxPro table. I used code like

IMPORT FROM d:\test.xls TYPE XL5 name d:\test.dbf

and always an OLE error code.

Can anyone out there help me? Thanks.

Ashley
 
Ashley,
According to the Help file, using the XL5 option limits you to Excel speadsheets created by Version 5.0 - the one in Office 95. If the spreadsheet comes from Excel 97 (version 8.0), and you have VFP 6.0, use XL8. If it comes from Excel 2000 (version 9.0) it "may" work using XL8 - but no guarantees.

You may have to resort to using the Excel ODBC driver, and reading the data this way - I've never done it, although I know it's been done.

Rick
 
Ashley

This is brute force, but might work for you.

clos all
crea table XLSTable (a C(10))
import from vehicles.xls XLS
brow

Chris
 
I have not had much luck with the import command. I do.

Use dbfstru
copy stru to xlsimport
use xlsimport
APPEND FROM [FileName] TYPE XL8 [SHEET SheetName ] AS [nCodePage]
David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top