I'm working on a program that parses a text file into a useful layout.
Here's the program.
https://drive.google.com/open?id=0B5_Yx6GF6MxqUWR0VmRlOXMxdWs
Here's the text file.
[TABLE="width: 978"]
<tbody>[TR]
[TD="class: xl65, width: 978"]http://api.eia.gov/bulk/EBA.zip[/TD]
[/TR]
</tbody>[/TABLE]
Here's the section of code that hangs up. If I hard code in the location of File_x the code will run. If I used the GetOpenFilename function the code hangs up. Another problem is that I can only run the program once because it uses up all the memory. Is there a way to purge the EBA_File after I've broken it up into smaller strings?
'***************************************************************
Here's the program.
https://drive.google.com/open?id=0B5_Yx6GF6MxqUWR0VmRlOXMxdWs
Here's the text file.
[TABLE="width: 978"]
<tbody>[TR]
[TD="class: xl65, width: 978"]http://api.eia.gov/bulk/EBA.zip[/TD]
[/TR]
</tbody>[/TABLE]
Here's the section of code that hangs up. If I hard code in the location of File_x the code will run. If I used the GetOpenFilename function the code hangs up. Another problem is that I can only run the program once because it uses up all the memory. Is there a way to purge the EBA_File after I've broken it up into smaller strings?
'***************************************************************
Code:
'Get EBA File
'***************************************************************
MsgBox "GET EBA"
File_x = Application.GetOpenFilename()
'File_x = "C:\EBA.txt"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFile = objFS.GetFile(File_x)
Set objTS = objFile.OpenAsTextStream(ForReading, TristateFalse)
EBA_File = objTS.Read(objFile.Size)
'***************************************************************
'Chop up EBA_File into Smaller Overlapping Strings
'***************************************************************
k = Application.RoundUp(Len(EBA_File) / 50000000, 0)
For i = 1 To k
String_Index(i) = Mid(EBA_File, (i - 1) * 50000000 + 1, 51000000)
Next i
'***************************************************************