Sorry for resurrecting an old link. However, I am trying to load a 10 MB text file with 190,000 lines and each line has fields separated by a comma. So, text file looks like below:
Code:
124, 456, 789, 147, 875, 547, 667
421, 576, 884, 189, 885, 475, 843
...190,000 lines
I load using ObjectFSO like below and read the complete file in one go
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTF = objFSO.OpenTextFile("D:\Data\Trac\Dny-Number.txt", 1)

strIn = objTF.readall
X() = Split(strIn, vbNewLine)
'X() = Strings.Split(strIn, vbNewLine)
Using VBA inbuilt Split function:
Code takes 0.69 seconds to read the complete file in variable strIn.
Code takes 0.94 seconds to load an array X() with 190,000 rows in 0.94 seconds.
So, time taken to run Split function 190,000 times is 0.94-0.69 = 0.25 seconds.

After loading the .bas file Strings, I redo the same setup with Strings.Split function given in this thread. I get following numbers:
Code takes 0.70 seconds to read the complete file in variable strIn.
Code takes 1.15 seconds to load an array X() with 190,000 rows in 0.94 seconds.
So, time taken to run Split function 190,000 times is 0.94-0.69 = 0.45 seconds.

Why is the Split function developed in this thread slower compared to VBA inbuilt Split function? Am I missing something?