> >
> > Mike,
> > Sorry I couldn't understand your requirement exactly. Maybe you want to change it directly in Excel w/o getting into VFP? If so:
> >
> >
lcXLS = getfile('XLS')
> > oExcel = createobject('Excel.Application')
> > with oExcel
> > .Workbooks.Open(m.lcXLS)
> > .Visible = .t.
> > with .ActiveWorkbook.Activesheet
> > for ix = 1 to .UsedRange.Rows.Count
> > if .Cells(m.ix,1).Value = '0125' and .Cells(m.ix,2).Value ='FDC'
> > .Cells(m.ix,2).Value = 'IDC'
> > endif
> > endfor
> > endwith
> > endwith
> >
> > This would be slow but for 20K might not be important. You can also directly open Excel sheet as a cursor (CursorAdapter and ACE OleDb driver - check message id 153776 for a sample) and do an update.
> >
> >
> > Or do you mean you want to put the changed data back to Excel? - 153776 has a sample for that too.
> >
> > PS: I think I need to repeat that it is not a CSV file. Append from .. type CSV would fail.
> >
> > Cetin Basoz
>
>
> This code looks like it will do the job. Since I already have the file open I plan to just run the code to change the FDC to IDC and then continue on with the orig. processing of the file into tables.
> Thank you and will give it a shot on Monday.
> Like I said you are on top of it!!If it actually a Excel workbook you could create an Excel macro with code similar to the .Net code and call it from Excel or open the worksheet and run the macro from some VFP code.
o = CREATEOBJECT('Excel.Application')
o.Workbooks.Open(...)
o.Run('macroname')
-Anders