+ Reply to Thread
Results 1 to 3 of 3

text import problem -- 1004

  1. #1
    Registered User
    Join Date
    03-01-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    34

    text import problem -- 1004

    With ActiveSheet.QueryTables.Add(Connection:= _
    "TEXT;" & ThisWorkbook.Path & "\1.txt", Destination:=Range("$A$1"))


    .Refresh BackgroundQuery:=False

    with the above code , i am getting the error 1004 "excel can not find the text file to refresh this external range"

    pl advise

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: text import problem -- 1004

    Obvious question: does the file exist in the same path\folder as the workbook containing the macro?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-01-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: text import problem -- 1004

    macro is in personal.xlsb

    text file and excel file are in same folder

+ 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. VBA problem with Print Range code run-time error 1004 text not valid reference
    By Jeep56 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-14-2013, 03:38 PM
  2. Import text problem
    By Anderaspr in forum Excel General
    Replies: 8
    Last Post: 01-04-2013, 12:35 PM
  3. problem with: import text files to excel -- format text
    By karthik123qwe in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-25-2012, 03:53 AM
  4. Replies: 0
    Last Post: 07-12-2012, 12:31 PM
  5. [SOLVED] Text Import Wizard: File Origin Problem
    By Baldbloke in forum Excel General
    Replies: 0
    Last Post: 03-29-2006, 09:55 AM
  6. [SOLVED] Import text file problem
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2005, 12:45 PM
  7. problem import text file
    By Lynn in forum Excel General
    Replies: 1
    Last Post: 10-02-2005, 06: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