It's got to do with the difference between ActiveWorkbook and ThisWorkbook.
ThisWorkbook always refers to the workbook file wherein the code is running from. If you change ThisWorkbook, to ActiveWorkbook, the code should run from the personal.xlsb file too.
ThisWorkBook object refers to the workbook that the code is contained in. ActiveWorkBook object refers to the workbook that is currently active.
Most times, they will refer to the same workbook. But if the workbook running the code is not the active workbook then they will point to different objects.




Reply With Quote
Bookmarks