+ Reply to Thread
Results 1 to 5 of 5

Data import folder

  1. #1
    Registered User
    Join Date
    05-05-2010
    Location
    sydney
    MS-Off Ver
    Excel 2003
    Posts
    2

    Data import folder

    Hi all,

    Can you please assist. I currently got a macro that imports data (.dat), however i can only get it to pick it up from a specified location. The requirement is to make it pick up the files (they are always the same) from the same location that the spreadsheet is in. So pretty much fileName = ActiveWorkbook.Path + "<file name>". However, i can not get it to work. Can someoine please help me make the path the active workbook path. Thanks.
    My current code is.

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 05-05-2010 at 07:10 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Data import folder help

    Hello maksim,

    Welcome to the Forum!

    To make posts easier to read, copy and edit, please use code tags. I have done this for you because you are new. Do take some time to read the forum rules. These help make it easier to find and get answers quickly to your questions.

    As a new member, please take some time to familiarize yourself with the rules.
    Click here for the Forum Rules
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data import folder help

    Hi Maksim. You don't show the rest of your macro, so I don't know if you're familiar with declaring and using variables.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    05-05-2010
    Location
    sydney
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Data import folder help

    THANK YOU!!!

    Its solved. Before posting, i tried declaring them path as variable but couldnt get the write syntax in the ""TEXT;" & fPath & fName, Destination:=Range("A1"))" line.
    But now its perfect.

    Once again, thank you!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Data import folder help

    Glad to help.

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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