Adam Ryczkowski
Adam Ryczkowski

Reputation: 8064

Get the name of workbook that hosts the currently running VBA code?

I'll also note, that the Application.Run("<workbook name>!<public VBA function name>") allows jumps of the execution to other workbooks without changing the ActiveWorkbook property.

I want to know the name of the workbook which hosts the currently executing VBA code.

In case if someone did understand me wrong:

Upvotes: 3

Views: 3676

Answers (1)

Siddharth Rout
Siddharth Rout

Reputation: 149287

I want to know the name of the workbook which hosts the currently executing VBA code.

Debug.Print ThisWorkbook.Name

Upvotes: 6

Related Questions