Difference between Thisworkbook.name and Activeworkbook.name in VBA

Activeworkbook.name is used to get the name of the active workbook from n different number of opened workbooks.

Thisworkbook.name is used to get the name of the workbook in which the code is written or stored in the module of that workbook.

E.g if you are writing the code in the module or sheet of workbook A then Thisworkbook.name will return A no matter which is the activeworkbook

Leave a Comment