+ Reply to Thread
Results 1 to 5 of 5

Pulling from a .txt file

  1. #1
    Registered User
    Join Date
    06-30-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    2007
    Posts
    5

    Pulling from a .txt file

    Hello,

    I'm looking for some help.

    Working in Access, i'm trying to pull data from a .txt file to populate cells in a table on another file.

    This is the command i'm using:

    Please Login or Register  to view this content.
    I'm getting an error because this command seems to only work while pulling from an excel file.

    How would i get it to work to pull from a .txt file?

    Any help would be appreciated!

    Thanks,

    Paul
    Last edited by alansidman; 11-12-2015 at 10:40 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Pulling from a .txt file

    You are using the Specification as "testnew." Have you set this specification up in the Advanced section of the importation procedure?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-30-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    2007
    Posts
    5

    Re: Pulling from a .txt file

    Hello alansidman,

    I did not-- and now that I did, it worked.

    Thanks you.

    Is there an alternate way to accomplish the same task? As in within the code itself? Or would I have to change the importation procedure every time?

    Thanks,

    Paul

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Pulling from a .txt file

    AFAIK, you have to set the specification each time you have a different layout for your text file. If you are doing one time imports then use the wizard import and not rely upon VBA.

  5. #5
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007/10
    Posts
    18

    Re: Pulling from a .txt file

    An alternative to using the import specification is to create a Schema.ini file which you locate in the same directory as the file you want to import - but as with the specification it needs to match the file being imported - including the file name so probably no benefit. Google schema.ini and access to find out how to use it. Here is an example link
    https://support.microsoft.com/en-us/kb/149090

+ 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. [SOLVED] Code for pulling file with date
    By cartica in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-27-2014, 01:07 PM
  2. [SOLVED] Pulling data from a csv file
    By rmachbitz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2013, 03:27 PM
  3. Trying to Save-As a pdf by pulling file name from a cell
    By DivingDoug in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2013, 04:03 PM
  4. [SOLVED] Help with a Vlookup pulling from another file
    By missmea2005 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-14-2012, 11:28 AM
  5. [SOLVED] VBA Userform Pulling data from txt file
    By TalResha in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-18-2012, 08:33 AM
  6. Pulling in data from CSV file with changing file name
    By adelcap in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 04-18-2012, 02:47 PM
  7. pulling data from a csv file
    By chachie22 in forum Excel General
    Replies: 2
    Last Post: 12-15-2010, 01:38 PM
  8. Pulling data from a charging file!
    By Badandy400 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-04-2007, 10:25 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