>Hi All
>
>I know this has all been asked before but as usual I'm looking for some fast pointers to get the ball rolling quickly :) I have an Excel spredsheet. it has four pages/tabs. I wish to extract all the data on each page and dump all cells into a DBF file, one DBF file per page/tab. Any quick ideas to get going?
>
>Thanks
One way:
#define xlDBF4 11
LOCAL oExcel AS Excel.Application, lcDBFName
oExcel = CREATEOBJECT([Excel.Application])
oExcel.WorkBooks.Open([MyXLS.xls])
oExcel.DisplayAlerts = .f.
FOR EACH oSheet IN oExcel.ActiveWorkBook.Sheets
oSheet.Activate
oExcel.Range([A1]).Select
oSheet.SaveAs(oSheet.name,xlDBF4)
NEXT
oExcel.ActiveWorkBook.Close()
oExcel.Quit()
oExcel = NULL
Of course if you know the exact sheet names and the Exact Sheet counts you could always do:
IMPORT FROM MyXls XL5 SHEET Sheet1 (real name of the sheet here)
IMPORT FROM MyXls XL5 SHEET Sheet2
etc.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.