Thanks Tsuji, the provision of the 'else' and error handling helped me track it down, and in the end it wasn't down to the vbs - it was a missing .js file in the directory containing the linked document (doh!) - your code is a lot tidier than mine, so it's going in! Thanks again, a great help.