So, if I'm reading this correctly, you're saying that NewMutex can return an Access Denied Error (5).
so the line
elsif ErrorNum = ERROR_ALREADY_EXISTS
should become
elsif ErrorNum = ERROR_ALREADY_EXISTS or ErrorNum = 5
I'm happy with that, but your construction with Choose doesn't look right. Can you confirm what's going on there?
cheers
Bruce