+ Reply to Thread
Results 1 to 5 of 5

Limiting FieldInfo while using OpenText method

  1. #1
    Registered User
    Join Date
    11-06-2009
    Location
    Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    48

    Limiting FieldInfo while using OpenText method

    I have a piece of software that exports a bunch of tables into a single text file. I am reading it into Excel 2007 with the OpenText method.
    The problem is that the Cable table includes a column called <Cable Size>, and per the American Wire Gauge standards some cable sizes are things like 2/0 (pronounced "two-aught"). Excel thinks it's a date...
    Cable Table Bad.PNG
    Cable Table Good.PNG

    I used the following recorded macro to pull this column in correctly, defining it as Text, but I really don't want to have to define the other column types AND worse, since there are other table below the cable table, it forces the fifth column of those tables to text as well...

    Please Login or Register  to view this content.
    I have attached a sample text file. What do I need to do to limit the area defined as Text to JUST the cable table and JUST the <Cable Size> column?
    Thanks!
    Verallia 130901-2 - Cable Test.txt

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Limiting FieldInfo while using OpenText method

    attach please a file xls with the whole desired result
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    11-06-2009
    Location
    Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Limiting FieldInfo while using OpenText method

    I have attached the requested Excel file with the hand modified result:
    I set E34:E100 to Text. Unfortunately, it messes up rows 41, 42, 96, 97 and 98, and I had to manually set them to 2/0 and 4/0. I would like to set E34:E100 to text on import, BEFORE those rows get messed up.
    Additionally, this all has to be macro based, as I import dozens of files that are similar to the provided .txt, though the affected range may change (always in Column E, but beyond that it could start at any row and be any number of rows long).
    Verallia 130901-2 - Cable Test.xlsx
    Thanks!
    Nathaniel

  4. #4
    Registered User
    Join Date
    11-06-2009
    Location
    Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Limiting FieldInfo while using OpenText method

    Anyone have a chance to look at this? My alternative is to write a code to look for Feb-00 and replace it with 2/0, which I'm not too excited about doing...

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Limiting FieldInfo while using OpenText method

    I looked at the two files, but I did understand nothing

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. OpenText Method FieldInfo Arrays
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-16-2007, 03:18 PM
  2. Workbooks.OpenText Fieldinfo
    By Peterppp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2007, 05:33 AM
  3. [SOLVED] Workbooks.OpenText method, FieldInfo parameter
    By SB in forum Excel General
    Replies: 7
    Last Post: 03-14-2006, 09:10 PM
  4. [SOLVED] opentext method
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2006, 03:55 AM
  5. [SOLVED] How to pass FieldInfo parameter to Workbooks::OpenText(...) in VC+
    By Lily in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2005, 09:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1