Hi all,

I want to import the contents of a text file into an Excel Sheet. I am using the following VBA code:
VB Code:
  1. Path = Workbooks("NITBSum_Macro.xls").Worksheets("Network").Cells(4, 2).Value
  2.     Workbooks.OpenText FileName:=Path & "JT_Insurance_Report.txt", Origin:= _
  3.         xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
  4.         xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
  5.         Comma:=False, Space:=False, Other:=True, OtherChar:="|", FieldInfo:= _
  6.         Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7 _
  7.         , 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array _
  8.         (14, 1), Array(15, 1))
  9.     Cells(1, 1).Select
  10.     Selection.EntireRow.Insert
This is working fine for most text files, however I have one file that has more than 100,000 lines, which exceeds the maximum allowed 65,000 lines in an excel document.

So my question is:
1. How can I get it to automatically create a second excel file with the remaining contents of the text file? At the moment it just returns an error when it reaches 65,000 lines.

Thanks,