ok... I thought that might happen.

Change the for each loop into a standard for next loop

For $line=0 to ubound($file)-1
If InStr($file[$line],$sOldString1)
$line = Join(Split($file[$line],$sOldString1),$newstring)
EndIf
Next
_________________________
How to ask questions the smart way <-----------> Before you ask