this is just a guess, but maybe the last line of the saved file is an empty line
try changing
For i = LBound(s1) To UBound(s1)
to
Code:
For i = LBound(s1) To UBound(s1) - 1
see if the error goes away