Arghh, I hate it when Windows 10 decides that it is going to do an update!

Sorry Graham, shortly after managing to get my last post in, I started to do a bit of searching on the internet and found the answer that seems to work. I have altered this line

CleanFilename = Replace(CleanFilename, Chr(arrInvalid(lng_Index)), Chr(95))
And have replaced it with this

CleanFilename = VBA.Strings.Replace(CleanFilename, Chr(arrInvalid(lng_Index)), Chr(95))

I found this suggestion here https://stackoverflow.com/questions/...rty-assignment


Now everything is working!

My thanks to you Graham for looking at this for me.

Steve