Vba Workbook Name Reference. From here, it gets a little complicated. VBA's ActiveWorkbook property refers to the workbook with the focus.
The Workbooks keyword refers to a collection of all open workbooks. My code follows with public variables. VBA ThisWorkbook means the workbook in which we are writing the excel code.
To refer to a workbook: Workbooks("NameOfFile.xls").
Custom function that will return the Workbook name and/or full path.
By doing this, you avoid having to change the code in the event you change the file name for your destination workbook. The Workbooks keyword refers to a collection of all open workbooks. You may also like some of this related content.