>Hi All,
>
> I'm trying to import an Excel Spreadsheet into a VFP6.0 DBF which has Memo Fields and the Memos aren't being populated. The reason that I need to use Memos is that some of the Cells in the Excel file Exceed 254 characters. After the Import all the character fields are populated correctly but the Memos are left empty even though there are corresponding Cells in the Excel File. I desperately need to extract the fields from Excel, I've even tried saving the file as CSV and importing/appending from a Delimited file but that doesn't work either. I'm assuming here that 'Append From' and 'Import From' don't work for Memos unless Appending from a DBF?
>
>Another way that I thought of to import the data was to use OLE to open the Spreadsheet and loop through the Cells and insert them into the DBF. Does anyone know how to read an Spreadsheet using OLE, I know how to create one using OLE but not how to do the reverse. I don't really want to use low level file functions either <s>.
>
>Thanks,
>Gavin...
Gavin,
This would read max 65000 cells into array :
#define xlLastCell 11
oExcel = createobject('Excel.Application')
With oExcel
.WorkBooks.Open(lcBookName)
With .Activeworkbook
.WorkSheets(lcSheetName).Activate
With .ActiveSheet
.Range("A1").SpecialCells(xlLastCell).CurrentRegion.Select
lnRows = .Application.Selection.Rows.Count
lnCols = .Application.Selection.Columns.Count
If lnRows * lnCols <= 65000
Dimension aExcelData[lnRows,lnCols]
Else
Dimension aExcelData[int(65000/lnCols),lnCols]
Endif
For ix = 1 to lnRows
For jx = 1 to lnCols
aExcelData[ix, jx] = .Cells(ix,jx).Value
Endfor
Endfor
Endwith
Endwith
.Activeworkbook.Saved = .t.
.quit
Endwith
Cetin