Hiya guys,

I have the following snippet of VBscript, which is causing the error 'Input past end of file', and is stopping some of the page loading.

IF f(0) = "CentrePanel" then		
				Set objFile = objFSO.OpenTextFile(FLocate & targetfile.name, 1)

				set SDivID = document.getelementbyid("centercontenta")

				TextInp(N) = objFile.ReadLine

				Set NDivPH = document.createelement("div")				Set NText = document.createtextnode(TextInp(N))
				NDivPH.id = "centercontent" & N					

				SDivID.AppendChild NDivPH
				NDivPH.innerhtml = "<h2 style='color: rgb(0,161,222); font-family: calibri;'>" & TextInp(N) & "</h2>"

				Set NDivP = document.createelement("div")

					Do While objfile.AtEndOfStream <> True
						TextInp(N) = objFile.ReadLine					
							SDivID.AppendChild NDivP						
							NDivP.innerHTML = NDivP.innerHTML & "<p style='font-family: arial;'>" & TextInp(N) & "</p>"
							N = N + 1
							Redim TextInp(N)														
				SDivID.AppendChild WLine
The specific line which IE is telling me is causing the error, I have highlighted in red.

Any ideas how I can fix this?