> Hi freinds,
>
> I'm working with excel automation where I want to pull excel data to my table . But sometime it is failed becoz field type in excel is differ. My code will only work when sepecific data range in excel file is general format i/o text format. So I decided to go for excel inbuilt TextToCoumns().
>
> code is
>
> #Define xlDelimited 1
> #Define xlDoubleQuote 1
> .Selection.TextToColumns("A1", DataType=xlDelimited, ;
> TextQualifier=xlDoubleQuote, ConsecutiveDelimiter=.F., Tab=.T., ;
> Semicolon=.F., Comma=.F., Space=.F., Other=.F.,FieldInfo=Array(1,1),;
> TrailingMinusNumbers=.T.)
>
> But VFP treat datatype,textqualifier as variable and throw error msg, so I change the below way
>
>
> .Selection.TextToColumns("A1", 1, ;
> 1, .F., .T., ;
> .F., .F., .F., .F.,[1,1],.T.)
>
> But again I'm getting OLE error msg !
>
> How can I define FieldInfo=Array(1,1) in VFP OLE ?
>
> Subhankar
you must use
with oExcel
.Columns('A:A').select
.Selection.TextToColumns(.Selection.Range("A1"),1,,.t.,,.t.)
EndWith
Other explanations see this message
Message ID: 81617Dont rate please.its only for the pleasure to help.
Yousfi Benameur