
Use a user-defined function to get the full
name of a workbook
We have learned how to determine the filename and path for a
workbook. To get both at the same time, we could combine the two
text strings. Another, more convenient way, however, is to use
user-defined function that delivers both the name and path of the
active workbook.
4
To determine the full filename and path of the workbook:
1. Press <Alt+F11> to open the Visual Basic Editor.
2. From the Insert menu, click Module.
3. Type the following function:
Function WkbFull()
WkbFull = ActiveWorkbook.FullName
End Function
4. Close the VBA Editor by pressing <Alt+Q> and in cell A5
type the following function: ...