ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ThisWorkbook/ActiveWorkbook (https://www.excelbanter.com/excel-programming/352826-thisworkbook-activeworkbook.html)

John Keith[_2_]

ThisWorkbook/ActiveWorkbook
 
What is the difference in using:
ThisWorkbook.Path
-vs-
ActiveWorkbook.Path

Or any of the other Properties or Methods that can follow.


--
Regards,
John

ben

ThisWorkbook/ActiveWorkbook
 
ThisWorkBook object refers to the workbook that the code is contained in


ActiveWorkBook object refers to the workbook that is currently on top
(Active) in Excel


They can return the same object, but if the workbook running the code is not
the active workbook then they will return different objects.

--
When you lose your mind, you free your life.


"John Keith" wrote:

What is the difference in using:
ThisWorkbook.Path
-vs-
ActiveWorkbook.Path

Or any of the other Properties or Methods that can follow.


--
Regards,
John


chubster264[_6_]

ThisWorkbook/ActiveWorkbook
 

Thisworkbook is always the workbook within which the macro is stored.
Activeworkbook is any member of the Workbooks collection - activated by
Workbooks(xx).activate

:)


--
chubster264
------------------------------------------------------------------------
chubster264's Profile: http://www.excelforum.com/member.php...o&userid=30164
View this thread: http://www.excelforum.com/showthread...hreadid=510304



All times are GMT +1. The time now is 05:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com