Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: subhankar pandey
  Where is subhankar pandey?
 Kolkata
 India
 subhankar pandey
 Tags
Subject: RE: TextToColumns issue
Thread ID: 210649 Message ID: 210706 # Views: 32 # Ratings: 0
Version: Visual FoxPro 6 Category: Active X Controls & OLE Automation
Date: Wednesday, January 07, 2009 2:10:33 PM         
   


> 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: 81617

Dont rate please.its only for the pleasure to help.
Yousfi Benameur



COMPLETE THREAD
TextToColumns issue Posted by subhankar pandey @ 1/7/2009 7:04:15 AM
RE: TextToColumns issue Posted by Anil Sharma @ 1/7/2009 8:14:58 AM
RE: TextToColumns issue Posted by subhankar pandey @ 1/7/2009 1:01:44 PM
RE: TextToColumns issue Posted by Yousfi Benameur @ 1/7/2009 2:10:33 PM
RE: TextToColumns issue Posted by subhankar pandey @ 1/8/2009 5:32:17 AM
RE: TextToColumns issue Posted by Cetin Basoz @ 1/7/2009 2:15:19 PM
RE: TextToColumns issue Posted by subhankar pandey @ 1/8/2009 6:11:31 AM
RE: TextToColumns issue Posted by Cetin Basoz @ 1/8/2009 4:39:00 PM
RE: TextToColumns issue Posted by subhankar pandey @ 1/9/2009 6:49:09 AM
RE: TextToColumns issue Posted by Cetin Basoz @ 1/9/2009 6:21:23 PM
RE: TextToColumns issue Posted by Borislav Borissov @ 1/9/2009 7:27:13 PM
RE: TextToColumns issue Posted by subhankar pandey @ 1/10/2009 5:48:25 AM