Terry,
I though Brian had changed the Code() operation, perhaps two years back, so that it would wait for the command the complete before returning, making the While/Wend unnecessary? Am I remembering it wrong? I seem to recall he added some other function to just buffer the command and return immediately. IIRC, this was done at the request of Dave Bagby for MSM.
Regards,
Ray L.