Thanks Solus.

I thought I was including .xls (in the getfilename function) but I must have been a numpty as it works fine now. Also good to know that the file has to be open in order to set the variable.

Thanks again, TC