Random Slow Down Of Text Import

  • Hello all,


    I have a rather puzzling scenario. Basically a text import (300mb file, there are 4 of them with random data of around 500,000 rows) takes 3 times longer the first time of running, than the second, so I see around 9mins for it to execute the first time but after that it seems to process in around 3mins. Now Ive had a look at networks, cpu, processing, and I cant see a reason for it. Its also quite random at what point it slows down, and sometimes it goes through fine. If I also stop the macro in slow mode and rerun, it goes quick up to the point of me closing it previous time. I have displaybreaks, screenupdating, calculation and events all switched off. This happens on all pcs ive tested on.


    Has anyone encountered a similar scenario? As I say, code works beautifully otherwise...



    Im at a loss as to why its doing this? Any ideas?

  • Re: Random Slow Down Of Text Import


    Ok so after MUCH head scratching....



    This macro is part of 5 files that get imported (the code is more or less the same with just a few tweaks). The issue is the parsing text to columns - now I have no idea why its an issue but can only assume something is getting held in memory which randomly slows down the next file (and again it is random). So ive given up on trying to understand why, but what I have found is if you remove the text to columns, and instead import all the text files THEN run the text to columns together, I get NO slowdown, and the files are consistently running (in my case under 3 mins for 10 files/sheets in total over around 1.5 million rows). I don't understand why running the macro a second time has no slowdown, so if anyone can "explain" that to me id be grateful, but for now ive tested this out over a dozen times and we are looking good ... Hope this helps someone else.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!