Sorted it!

It was another issue lower down in the code, a missing ENDIF causing the compiler not to find the the two NEXT statements.

It was really bugging me for a while. Should have had a cup of coffee and re-look at the code.

Lesson learned !

Thank for the forum space