+ Reply to Thread
Results 1 to 4 of 4

Error importing data from csv file

  1. #1
    Registered User
    Join Date
    03-02-2012
    Location
    Toulouse
    MS-Off Ver
    Excel 2007
    Posts
    24

    Question Error importing data from csv file

    Hello everyone!

    I have recorded a simple macro that imports text from a csv file, divides it in columns using the "," separator and pastes it in the A1 cell of my workbook. Simple. Then I have added some lines to prompt the user to select the file that will be imported.

    Please Login or Register  to view this content.
    The problem is that I get an error on the last line of the With: ".Refresh BackgroundQuery:=True" and I don't know why. It says "Run-time error '1004': Excel cannot find the text file to refresh this external data range. Check to make sure the text file has not been moved or renamed, then try the refresh again."

    I have done some research on Google and I find people with similar problems but not exactly the same thing.

    I am specially annoyed because this code worked on Friday before leaving the office but will not work now...

    Thanks in advance for any tips you might give me.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Error importing data from csv file

    Suggest you post the workbook with code and as sample csv file so we can test it.

    Do you specifically want a Query, or are you open to offers?

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-02-2012
    Location
    Toulouse
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Error importing data from csv file

    Hi!

    I just figured it out, there was a problem with the way the name of the file was sent to the connection. Noob mistake. I typed:

    Please Login or Register  to view this content.
    And it should be:

    Please Login or Register  to view this content.
    Thanks!

  4. #4
    Registered User
    Join Date
    11-04-2018
    Location
    Oslo
    MS-Off Ver
    2016
    Posts
    1

    Re: Error importing data from csv file

    Thanks!

    Your answer solved the same problem I had.

+ 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. Importing a data from a text file - user-defined file
    By DaveSev in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2013, 07:02 PM
  2. Error with importing text file from a filepath listed in a list box
    By duncanm82 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2012, 08:16 PM
  3. [SOLVED] Made big error importing text file with dates
    By excelaron in forum Excel General
    Replies: 3
    Last Post: 07-11-2012, 07:36 PM
  4. [SOLVED] Error importing txt file
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2012, 09:46 AM
  5. Error: during importing an excel file into an online system
    By aveeator in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 02-13-2011, 12:19 PM

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