Try replacing "ThisWorkbook" with "ActiveWorkbook" and let me know

There might be other instances of "ThisWorkbook" that need to be changed