View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Klips Klips is offline
external usenet poster
 
Posts: 6
Default Slow Text File Import

On May 7, 5:18 pm, "Jim Cone" wrote:
Have you considered opening the text file directly into Excel
and then formatting the file. Excel plops a text file into the
first column of a worksheet in tenths of a second...

Sub OpenTextFile()
Workbooks.Open "F:\Acme\Z2Compliance.txt"
End Sub

Also, have you declared all of your variables?
The code you posted doesn't show anything declared.
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware

"Klips" wrote in ooglegroups.com...

Hi all,
I'm having problems finding out why the performance of my text file
import routine takes a hit after the first import operation. I have a
series of text files with a set format that I'd like to import into
individual sheets in excel. I have written a procedure that takes care
of this. The first file that I import is extremely fast. As soon as I
import the next file, the speed drops to 1/10 of the first time. The
speed deteriorates as I import more files, but the drop is more
gradual.

Here is the import code:
-snip-Any help is appreciated. If someone wants to take a look at the
complete file with sample text files, just let me know.
Thanks


The problem is that I'm not sure if this performance issue has
anything to do with reading the data in. I feel like it is more a
problem of how content gets assigned to cells. I have put all the code
in a textfile at http://www.lapse.ca/code.txt in case you need to look
at it. I'm using Option Explicit, so variables seem to be all defined.
The code is executed by pushing a button on a userform.

Any help is appreciated.