>Hi All,
>
>Is there any function or utility is available in VFP to convert ";" deleimited text file to MS Excel.
>
>TIA
>Ajay
Ajay,
You could use OPenText method.
If you know the format of fields create an array defining it.
oExcel.Workbooks.OpenText(lcSemiColonFile,,,xlDelimited,,,,.T.,,,,, @arrFldSemicolonInfo)
If you don't have it the do not pass field info array.
oExcel.Workbooks.OpenText(lcSemiColonFile,,,xlDelimited,,,,.T.)
Field info array is two dimensional where first defines the column order and second formatting. ie:
If you would export 10 columns where 5,6th columns are date type and you want them as MDY (rest text):
#DEFINE xlDelimited 1
#DEFINE xlFixedWidth 2
#DEFINE xlGeneralFormat 1
#DEFINE xlTextFormat 2
#DEFINE xlMDYFormat 3
#DEFINE xlDMYFormat 4
#DEFINE xlYMDFormat 5
#DEFINE xlMYDFormat 6
#DEFINE xlDYMFormat 7
#DEFINE xlYDMFormat 8
#DEFINE xlSkipColumn 9
#DEFINE xlEMDFormat 10
dimension arrFldSemicolonInfo[10,2]
for ix=1 to 10
arrFldSemicolonInfo[ix,1]=ix
arrFldSemicolonInfo[ix,2]=xlTextFormat
endfor
arrFldSemicolonInfo[5,2]=xlMDYFormat
arrFldSemicolonInfo[6,2]=xlMDYFormat
Cetin