1. For now, remove the UCase( ) around p.path and see if the error goes away
I've removed that from isFolderExcluded sub, isFileExcluded sub and isSpecificFileExcluded sub. Still getting the same error