OK, somewhat embarrassingly, I've found the error in some of the code I didn't reproduce. I'd accidentally got a close statement between the open statement and the macro, and now I've moved that it works fine. Thanks very much for your help, though - you got me looking wider to find the problem!
... View more