Apologies - you need to bear with me - I am truly a novice with this sort of thing. I have tried again putting this in a procedure and replacing the original code. I put the constants in a separate module. Don't know if I needed to. Still getting an error:
pic.jpg