ThisWorkbook should refer to the workbook in which the macro is running.

You can declare a workbook variable:
dim wb as workbook
and then set that variable to a workbook using "Workbook.Open":
set wb = Workbook.Open(<fullpathandworkbookname>)
or you can select an already open workbook using its name

set wb = Workbooks(<yourworkbookname>)