+ Reply to Thread
Results 1 to 5 of 5

VBA Importing Text File makes the file longer to load everytime

  1. #1
    Forum Contributor
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    108

    VBA Importing Text File makes the file longer to load everytime

    Hi -

    I have a recorded macro of the Get External Data - From Text but I noticed that when after saving and when I open again the file its always taking the longer to load?

    Is there some kind of explanation for this?

    Thank you
    Hudas

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Importing Text File makes the file longer to load everytime

    Do you still have a connection to the text file?

    Have you tried using OpenTextFile?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: VBA Importing Text File makes the file longer to load everytime

    Hi Norie

    Not sure what you mean but below is the code that i record and made some changes on.

    Please Login or Register  to view this content.
    Thank you

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Importing Text File makes the file longer to load everytime

    Your code sets up a connection to the text file.

    That connection could be being refreshed when you open the workbook, hence the slow opening.

    Either break the connection or use a method of import that doesn't create one in the first place, eg OpenTextFile.

  5. #5
    Forum Contributor
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    108

    Re: VBA Importing Text File makes the file longer to load everytime

    Hi Norie

    I added this to code above. I think this solves the problem.

    Please Login or Register  to view this content.
    Thank you

+ 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. [SOLVED] importing text file into excel file using macro
    By ananthbulusu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2013, 04:08 PM
  3. Importing a text file to an existing sheet, with a dialog to pick the text file
    By titushanke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2011, 01:43 PM
  4. code to check file size everytime an Excel file is opened
    By Kaiser in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-30-2006, 12:50 PM
  5. Importing text file, only option to edit existing file
    By smokey99 in forum Excel General
    Replies: 8
    Last Post: 04-26-2006, 04:08 PM

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