>The last part, the modify and to copy a table to type xls format is easy, but is there any easy way to open an excel file as a formated table in VFP so that I can modify, add columns, etc. then return the results to excel. The only part I would need to know is how to open an excel file up as a table in VFP or somehow copy it in a way to convert it that I can open it.
Kevin,
An excel file might be in a format that's incompatable with VFP. If you're sure it'd always be you could simply saveas a fox2x dbf. ie:
lcXLS = getfile('XLS')
lcfilename = SYS(5)+CURDIR()+'FromExcel.dbf'
oExcel = CREATEOBJECT('excel.application')
with oExcel
.Displayalerts = .f.
.WorkBooks.Open(lcXLS)
.ActiveWorkBook.SaveAs(lcfilename,8)
.Activeworkbook.saved = .t.
.Quit()
endwith
This saves a workbook (active-first sheet) as a dBaseIII (fox2x) file. Columns are automatically named as A,B.... and types are set. After modification you could simply write over old xls as type xl5.
However his would work with only strict formats and limited rows. Depending on your purpose it might be easier to open in excel and directly do modification there with automation.
Cetin