+ Reply to Thread
Results 1 to 1 of 1

macro to import text file

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    macro to import text file

    I have created a spreadsheet for about 30-40 users that imports a text file and does some other manual calculations. Below is part of the code that imports the text file.

    Please Login or Register  to view this content.
    At least once a week I receive an email from a user indicating the macro doesn’t work and they keep getting an error. The problem with the code is really three-fold.

    1-The text file that is imported must always be named “text_file.txt”
    2-The text file must always be saved to the desktop
    3-The user file must always be called “ClientList.xls”

    I am finding out that when they import the text file they are not saving to the desktop. Instead they save to the O: drive, the C: drive, to a personal folder, etc. I also discovered they have renamed the user file to “Client”, or “ClientNames”, or “ListofClients”, etc. They are also renaming the text file.

    I really need to modify this code so that when the user imports the text file, these errors do not occur.

    How would I modify the code so that when prompted to import data, the user can actually choose the file they wish to import (like when you open a file in Excel)? I want to give the user the ability to choose the path name and file name.

    Also, the txt file that is used is separated by “|”. I have attached a sample of user file and text file used if needed.

    I hope this explanation isn’t overkill. Thanks of any assistance
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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